I am trying to get a function from the package ModelT into my Controllers package . I have looked at the example on Call a function from another package in Go however it is not working. This is my simple code
package ModelT
-- Print.go
func PrintMe() string {
return "hello"
}
package Controllers
-- Circle.go
import ("Yislyapp/ModelT") -- This does not work
func Circle_List() {
ModelT.PrintMe()
}
My small program won't compile either saying: can not resolve directory yislyapp . I get the samething even if I change it to Yisly-Backend/ModelT or Yisly-Backend./ModelT , it seems like it can't find the package. Any suggestions would be great since i'm starting out. If I put it into my Go file Home.go then it works
import (
"./ModelT"
)
func main() {
ModelT.PrintMe() -- This works in my Home.go file
}