when i try to enter "go get -u github.com/gin-gonic/gin" in goland terminal, then it shows nothing , wait for 10 sec it prints infos below:
go get github.com/gin-gonic/gin: module github.com/gin-gonic/gin: Get "https://proxy.golang .org/github.com/gin-gonic/gin/@v/list": dial tcp 34.64.4.113:443: connectex: A connection a ttempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.
and i dont know how to solve ,
when i enter the code in cmd, it worked fine , but i cant import packages, and can`t find the gin packages
Comment From: bestgopher
show go env
Comment From: DroidLin
show
go env
this is go env:
set GO111MODULE=on set GOARCH=amd64 set GOBIN= set GOCACHE=C:\Users\TenderLove\AppData\Local\go-build set GOENV=C:\Users\TenderLove\AppData\Roaming\go\env set GOEXE=.exe set GOFLAGS= set GOHOSTARCH=amd64 set GOHOSTOS=windows set GOINSECURE= set GONOPROXY= set GONOSUMDB= set GOOS=windows set GOPATH=E:\ProgrammingWorks\Go set GOPRIVATE= set GOPROXY=https://goproxy.io set GOROOT=E:\GolangSDK set GOSUMDB=sum.golang.org set GOTMPDIR= set GOTOOLDIR=E:\GolangSDK\pkg\tool\windows_amd64 set GCCGO=gccgo set AR=ar set CC=gcc set CXX=g++ set CGO_ENABLED=1 set GOMOD=NUL set CGO_CFLAGS=-g -O2 set CGO_CPPFLAGS= set CGO_CXXFLAGS=-g -O2 set CGO_FFLAGS=-g -O2 set CGO_LDFLAGS=-g -O2 set PKG_CONFIG=pkg-config set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\TENDER~1\AppData\Local\Temp\go-build122119786=/tmp/go-build -gno-record-gcc-switches
Comment From: bestgopher
GOPROXY="https://goproxy.cn,direct"
Comment From: Jack-Kingdom
It's a network error. How about have a try to remove the GOPROXY env in cmd.
Comment From: DroidLin
GOPROXY="https://goproxy.cn,direct"
i reinstall the sdk, and then redownload the gin, it worked fine ,but the packages are not right, they all contains some charactors like "@{version}" appended problems solved by move the directory to "${GOROOT}/src", then i rename the folder, all thing got done
thx
Comment From: moniqueds
@lza1047771038 i'm having some error like yours: could not import github.com/gin-gonic/gin (cannot find package "github.com/gin-gonic/gin" in any of C:\Program Files\Go\src\github.com\gin-gonic\gin (from $GOROOT) C:\Users\MONIQUE\go\src\github.com\gin-gonic\gin (from $GOPATH))
I'm a beginner and i tried everything to solve, but no sucess. Can you help me?
Comment From: bestgopher
go get github.com/gin-gonic/gin and then try to import it again.
Comment From: moniqueds
@bestgopher i have no idea what to do. still having error message.
Comment From: jincheng9
use go module.
Comment From: sedhha
go get github.com/gin-gonic/gin
Hey were you able to resolve the error?
Comment From: cptiwari20
Hey, I have the same issue on this., exactly as @moniqueds shared above. Did anyone find any solution? Please share.
Comment From: EmreCogac
if your project have go.mod : go get github.com/gin-gonic/gin but if you dont have go mod init 'example.go' and again paste this in terminal go get github.com/gin-gonic/gin .
Comment From: Asef264
Check your GOPATH and GO111MODULE settings:
Ensure that your GOPATH environment variable is correctly set.
It should point to the directory where your Go projects are located.
If you're using Go modules (GO111MODULE=on),
ensure that your project is located outside of GOPATH and that you have initialized Go
modules in your project directory.
Comment From: EmreCogac
You're actually right! Thank you for comment.