Home [Golang] go module 'connection refuesd' 오류 해결
Post
Cancel

[Golang] go module 'connection refuesd' 오류 해결

Go module ‘connection refuesd’ 오류 해결

에러

  • go mod tidy 로 module 설치 시 connection refused에러 발생
1
2
3
github.in/misc@v0.0.0-20220602070448-f6621fa768b4: verifying go.mod: github.in/misc@v0.0.0-20220602070448-f6621fa768b4/go.mod: reading https://sum.golang.org/lookup/github.in/misc@v0.0.0-20220602070448-f6621fa768b4: 410 Gone
        server response: not found: github.in/misc@v0.0.0-20220602070448-f6621fa768b4: unrecognized import path "github.in/misc": https fetch: Get "https://github.in/misc?go-get=1": dial tcp 10.182.235.107:443: connect: connection refused
make: *** [mod_tidy] Error 1

해결법

1
2
$ export GOSUMDB=off
$ go get -u

or

1
2
3
4
# Private repo 의 특정 commit 을 패키지로 설치하려면 commit hash 값을 넣어주고 go mod tidy 를 수행하자!
# go.mod -> github.in/misc 399aadab40d5f49539d80310ff133f6c31fe51f8
$ go mod tidy
# -> 자동으로 해당 패키지를 get 해 옴

참고 : https://lejewk.github.io/go-mod/

This post is licensed under CC BY 4.0 by the author.