1
I have a problem that I cannot solve and would like help if possible. I am new to golang language. During a tutorial that was following regarding the language, a script was created with the bcrypt package, following the step by step was informed the package installation command:
go get -u golang.org/x/crypto/bcrypt
When performing the process as reported, I tried to execute the code and presented and presented the following error message:
024_Aplicacoes/06_bcrypt.go:9:8: no required module provides package github.com/crypto/bcrypt: go.mod file not found in current directory or any parent directory; see 'go help modules'
I’ve tried a lot of lawsuits:
- Create the golang.org/x folder inside src
- I changed the content of go.mod
- I tried to instate via github with and without the github folder
I’m a little upset by catching on to something so trivial. Below follows: Tried Operating System: Windows10 and Ubunto 20 LTS golang versions tried 1.16.2(ubunutu) / 1.16.3 (windows10)
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/tarcisio/.cache/go-build"
GOENV="/home/tarcisio/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/tarcisio/.asdf/installs/golang/1.16.2/packages/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/tarcisio/.asdf/installs/golang/1.16.2/packages"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/home/tarcisio/.asdf/installs/golang/1.16.2/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/home/tarcisio/.asdf/installs/golang/1.16.2/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.16.2"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build770863381=/tmp/go-build -gno-record-gcc-switches"
I know I have a long way to go before I came here seeking resolution I tried, however unsuccessful.