Use:

go run *.go

or

go build *.go


On Wednesday, October 23, 2019 at 1:20:26 AM UTC-4, Cam wrote:
>
> Hi everyone on Golang group,
>
> I'm having difficulty with some simple code, and appreciate if someone can 
> point out a solution.
>
> There is a simple main package that looks like this:
>
> github.com/username/playground/
>                                                             hello.go
>                                                             main.go
>
> hello.go:
>
> package main
> import "fmt"
> func SayHello() {
>   fmt.Println("Hello")
> }
>
> main.go
>
> package main
> func main() {
>   SayHello()
> }
>
> Trying to run main.go is producing an error:
>
> # command-line-arguments
> go/src/github.com/username/playground/main.go:4:2: undefined: SayHello
>
> Why is this error happening? Is my packaging done wrong?
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/60761190-7275-46a6-87d9-a0d1ff627802%40googlegroups.com.

Reply via email to