I'm getting this error when running a .go file.
./instance.go: line 1: package: command not found
./instance.go: line 3: syntax error near unexpected token `newline'
./instance.go: line 3: `import ('
So far I've seen that the error normally means that GOPATH is not set, however, echo "$GOPATH"
outputs /root/go
and my path is currently /bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/go/bin:/root/go/bin:/bin:/root/go/bin
.
Here's the first few lines of instance.go:
package webrun
import (
"context"
"crypto/hmac"
"crypto/rand"