我有两个main.go
以下的文件,还有一个包中有一些函数的文件,叫做functions.
我的问题是:如何调用package main
中的函数?
File 1: main.go (located in MyProj/main.go)个
package main
import "fmt"
import "functions" // I dont have problem creating the reference here
func main(){
c:= functions.getValue() // <---- this is I want to do
}
File 2: functions.go (located in MyProj/functions/functions.go)个
package functions
func getValue() string{
return "Hello from this another package"
}