My first solution was to create _netrc and modules installed even without env variables:
GOPRIVATE, GOPROXY, GONOSUMDB
.
This solution doesn't need code below to make HTTPS requests authorized as well.
git config --global url."https://oauth2:<access_token>[email protected]".insteadOf "https://gitlab.project.tech"
Must to mention, I'm using ssh and have configured .ssh/config to gitlab.
So, I started shuffle everything and after all I discovered that removing GOPRIVATE
was the key.