Create with multiple files in GO (GO1)
Does anyone know if the "go build" command can be used to build from multiple files in a directory? for example
src/ file1.go file2.go
Where file1.go contains func main () method and file2 provides supporting functions. I have tried using the following import statements but I am not getting there
import (
"file2"
)
import (
file2 "./file2"
)
I am wondering if this is the case that I need to change the GOROOT environment variable in order to get this to work. Or if I just get tired and miss something blindingly obvious.
thank
+3
source to share
1 answer