A
A
anijack2021-09-16 17:02:02
go
anijack, 2021-09-16 17:02:02

Why does Golang install packages in the wrong place?

When installing a package ( go get github.com/go-sql-driver/mysql), golang places it not in $GOPATH/src/, but in $GOPATH/pkg/mod
Moreover, in $GOPATHaddition to pkg/, there is neither bin/ nor src/

Please help, how does this happen?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene, 2021-09-16
@anijackich

From version 1.6, modules are enabled by default, regulated by this GO111MODULE environment variable, if you need the old behavior, then set it off, more details here https://go.dev/blog/go116-module-changes
But it's better to migrate to modules

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question