0
I’m having a hard time importing a library from do go. The library is in a folder in the same project directory and always of the import error, when not of the import error, of the error to access the function.
main go.
package main
import (
"fmt"
"./test"
)
func main(){
test.makeCalc(1,1)
fmt.Println("test.makeCalc(3,6)")
}
test go.
package test
func makeCalc(x int, y int) int{
return x+y
}
where is your project? within the
GOROOT
?– RFL
no, it’s in a normal folder
/home/user/projecst/go/test/
– Brumazzi DB
According to the specification, the interpretation of the
import
depends on the compiler implementation. I recommend usingimport
with the canonical name of the package.– Anderson F. Viana