File: $GOPATH/src/scratch_go_code/main/main.go
package main
import "fmt"
func main() {
fmt.Println("Hello World")
cloud := Cloud{}
cloud.Say()
}
file $GOPATH/src/scratch_go_code/main/cloud.go
package main
import "fmt"
type Cloud struct{}
func (Cloud) Say() {
fmt.Println("I'm a cloud in the main package")
}
Running: go install scratch_go_code/... && go run main/main.go throws:
# command-line-arguments
main/main.go:7: undefined: Cloud
Any idea why?