I have a project using github.com/gofiber/fiber
package. I don’t use go modules, i.e. my GO111MODULE="off"
.
When i try go build .
i get following:
<code># github.com/gofiber/fiber
../github.com/gofiber/fiber/helpers.go:300:12: undefined: fasthttp.VisitHeaderParams
../github.com/gofiber/fiber/helpers.go:441:14: undefined: fasthttp.VisitHeaderParams
<code># github.com/gofiber/fiber
../github.com/gofiber/fiber/helpers.go:300:12: undefined: fasthttp.VisitHeaderParams
../github.com/gofiber/fiber/helpers.go:441:14: undefined: fasthttp.VisitHeaderParams
</code>
# github.com/gofiber/fiber
../github.com/gofiber/fiber/helpers.go:300:12: undefined: fasthttp.VisitHeaderParams
../github.com/gofiber/fiber/helpers.go:441:14: undefined: fasthttp.VisitHeaderParams
When i try go get github.com/gofiber/fiber/v2
i get:
<code>cannot find package "github.com/gofiber/fiber/v2" in any of:
/usr/local/go/src/github.com/gofiber/fiber/v2 (from $GOROOT)
/home/igor/go/src/github.com/gofiber/fiber/v2 (from $GOPATH)
<code>cannot find package "github.com/gofiber/fiber/v2" in any of:
/usr/local/go/src/github.com/gofiber/fiber/v2 (from $GOROOT)
/home/igor/go/src/github.com/gofiber/fiber/v2 (from $GOPATH)
</code>
cannot find package "github.com/gofiber/fiber/v2" in any of:
/usr/local/go/src/github.com/gofiber/fiber/v2 (from $GOROOT)
/home/igor/go/src/github.com/gofiber/fiber/v2 (from $GOPATH)
I have /home/igor/go/src/github.com/gofiber/fiber
installed, without postfix /v2
When i try doing the same with GO111MODULE=”on” i get:
<code>~/go/src/ip_mit_service$ go build .
main.go:6:2: package ip_mit_service/conf_pack is not in GOROOT (/usr/local/go/src/ip_mit_service/conf_pack)
main.go:25:2: package ip_mit_service/http_service is not in GOROOT (/usr/local/go/src/ip_mit_service/http_service)
main.go:26:2: package ip_mit_service/inot_ent_check is not in GOROOT (/usr/local/go/src/ip_mit_service/inot_ent_check)
main.go:16:2: package ip_mit_service/tables_check is not in GOROOT (/usr/local/go/src/ip_mit_service/tables_check)
<code>~/go/src/ip_mit_service$ go build .
main.go:6:2: package ip_mit_service/conf_pack is not in GOROOT (/usr/local/go/src/ip_mit_service/conf_pack)
main.go:25:2: package ip_mit_service/http_service is not in GOROOT (/usr/local/go/src/ip_mit_service/http_service)
main.go:26:2: package ip_mit_service/inot_ent_check is not in GOROOT (/usr/local/go/src/ip_mit_service/inot_ent_check)
main.go:16:2: package ip_mit_service/tables_check is not in GOROOT (/usr/local/go/src/ip_mit_service/tables_check)
</code>
~/go/src/ip_mit_service$ go build .
main.go:6:2: package ip_mit_service/conf_pack is not in GOROOT (/usr/local/go/src/ip_mit_service/conf_pack)
main.go:25:2: package ip_mit_service/http_service is not in GOROOT (/usr/local/go/src/ip_mit_service/http_service)
main.go:26:2: package ip_mit_service/inot_ent_check is not in GOROOT (/usr/local/go/src/ip_mit_service/inot_ent_check)
main.go:16:2: package ip_mit_service/tables_check is not in GOROOT (/usr/local/go/src/ip_mit_service/tables_check)
But these packages must be in GOPATH, not in GOROOT. And they Are in GOPATH actually, but compiler wants them to be in GOROOT. This is why i dont use Go modules. Now i don
t know how to compile my code. Any advise will be appreciated. What source should i read to know hoe to solve this problem?
Earlier i just typed go build .
and programm was compiled, with GO111MODULE=”off”