These are not Go errors.
However, I was able to reproduce your errors by trying to execute a go source file:
$ chmod +x in.go $ ./in.go ./in.go: line 1: package: command not found ./in.go: line 3: syntax error near unexpected token `newline' ./in.go: line 3: `import ('
You can't do this with Go, since it is not interpreted. You need to compile your code to an executable before you can run it.
You can read the help for how to compile and run a go program here.
In your case,
go run instance.go
will try to compile and run the source file you're executing, but as another commenter points out, code that is not in the
main package is not designed to be executed directly.
If this is your code, you need to write it inside
package main, and if it is not, then you're probably trying to execute a library (which means it's not clear to me what you're trying to do).