michaelb / sniprun

A neovim plugin to run lines/blocs of code (independently of the rest of the file), supporting multiples languages
MIT License
1.48k stars 48 forks source link

SnipRun failed to build in go, if last line is comment.. #247

Closed soluty closed 1 year ago

soluty commented 1 year ago

Describe the bug as title

To Reproduce

  1. in main.go file, add print(1)\n // comment , select it
  2. Run the command 'SnipRun'
  3. See error 'Compile-time error: .cache/sniprun/go_ori ginal/main.go:3:14: syntax error: unexpec ted EOF, expected }'

Expected behavior can run succuss

Additional context content of .cache/sniprun/go_original/main.go

package main
func main() {  print(1)
  // comment}
michaelb commented 1 year ago

This should be an easy fix

Thanks a lot for the report