0

I have a simple Go program, a basic hello world copied from a tutorial somewhere. I am using Eclipse with the GoClipse functionality added. If I right click on the folder the application is in, and run it as a Go application it works. If I go to the command prompt and type either go run or go build it works, either for the specific file with the main program or the outside directory.

However if I try to build the project I get the error:

# golang.org/x/tools/cmd/splitdwarf
runtime.main_main·f: function main is undeclared in the main package

My program is:

package main

import "fmt"

func main() { fmt.Println("Hello World")  }

The directory structure is:

$GOPATH/src/foo/bar.go

GOPATH is C:\goSpace and GOROOT is `C:\Go

Nefarious
  • 458
  • 6
  • 21

0 Answers0