-1
I’m trying to call a function from another package on main
but when I import and try to use the exported function returns the error of "package functions imported but not used"
.
Function.go
(go/src/github.com/dashadelas/test/functions/Function.go)
package functions
import (
"fmt"
)
func GetFunction() {
fmt.Println("teste")
}
main go.
(go/src/github.com/dashadelas/teste/main.go)
package main
import (
"github.com/dashadelas/teste/functions"
)
func main() {
GetFunction()
}
Can anyone tell me the origin of this mistake? I executed the go mod init
, go mod tydi
and the go mod vendor
also!
I think $GOPATH is quiet, because when I run "CD $GOPATH" it opens the Go folder!
– Dasx