I have this directory layout:
/baba
biz.go # package baba
/hello
foo.go # package main
biz.go looks like this:
package baba
func Foodd(z int) int {
return z + 5
}
and foo.go looks like this:
package main
import (
"fmt"
"log"
)
func main() {
log.Fatal(Foodd(3))
}
currently this doesn't compile because Foodd
is not recognized. How do I import the baba
package in foo.go
?
I assume if I compile like so, that it will pull in the right files:
go build foo.go
Or do I need to include the files in the baba package in the go build
command? (I would hope not).