I've been working in go for a little while and this weekend I wanted to try to deploy some server code. When I run go build
on some very simple code to test if Go is working I get this error:
can't load package: ($HOME)/go/src/goTest/main.go:4:2: non-standard
import "fmt" in standard package "goTest"
import cycle not allowed
package goTest
imports fmt
imports errors
imports runtime
imports runtime/internal/atomic
imports unsafe
imports runtime
In my ~/.bashrc I'm running this to set environment variables.
export GOPATH=/usr/local/go
export GOBIN=$GOPATH/bin
export PATH=$PATH:$GOBIN
My go workspace is in $HOME/go
and my go install is at the default /usr/local/go
. Any help is appreciated
main.go
package main
import (
"fmt"
)
func main() {
fmt.Println("test")
}
Edit: go version
is go1.6 linux/amd64