Answer the question
In order to leave comments, you need to log in
Go build: Can't find package, duplicate src in package search path, what's wrong?
I can't figure out how to connect the package (GO, CentOC).
Structure: echo $GOPATH
/var/www/go/src
In main.go (file path: /var/www/go/src/lesson/main.go) I try to include the models package from the User.go file (file path: /var /www/go/src/lesson/models/User.go)
Content of main.go :
package main
import "lesson/models"
package models
Answer the question
In order to leave comments, you need to log in
Inside $GOPATH src, bin, pkg are created. That is, make GOPATH=/var/www/go
In general, tie with $GOPATH and switch to modules
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question