LoginSignup
1
1

More than 1 year has passed since last update.

【小ネタ】Windows環境でgo get がプロキシの関係で入らないとき

Posted at

はじめに

つまづいたのでメモ

Vesrion

go version go1.14.4 windows/386

何が起きたか

プロキシ環境下で go getするとうまくいかない。

A connection attempt 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.

Git の設定やVisualStudioCodeの設定を見直してもうまくいかない。

どうしたか

コマンドプロンプトを開いて以下の環境変数を宣言

SET http_proxy=プロキシURL:ポート番号
SET https_proxy=%http_proxy%

そして、go get

$ go get -v github.com/labstack/echo
go: downloading github.com/labstack/echo v1.4.4
go: downloading github.com/labstack/echo v3.3.10+incompatible
go: github.com/labstack/echo upgrade => v3.3.10+incompatible
go: finding module for package github.com/labstack/gommon/log
go: finding module for package github.com/labstack/gommon/color
go: downloading github.com/labstack/gommon v0.3.0
go: finding module for package golang.org/x/crypto/acme/autocert
go: downloading golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97
go: found github.com/labstack/gommon/color in github.com/labstack/gommon v0.3.0
go: found golang.org/x/crypto/acme/autocert in golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97
go: downloading github.com/mattn/go-colorable v0.1.2
go: downloading github.com/mattn/go-isatty v0.0.9
go: downloading golang.org/x/net v0.0.0-20210226172049-e18ecbb05110
go: downloading github.com/valyala/fasttemplate v1.0.1
go: downloading golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1
go: downloading github.com/valyala/bytebufferpool v1.0.0
go: downloading golang.org/x/text v0.3.3
github.com/mattn/go-isatty
github.com/valyala/bytebufferpool
golang.org/x/text/transform
github.com/mattn/go-colorable
github.com/valyala/fasttemplate
golang.org/x/text/unicode/bidi
golang.org/x/text/unicode/norm
golang.org/x/crypto/acme
github.com/labstack/gommon/color
golang.org/x/text/secure/bidirule
github.com/labstack/gommon/log
golang.org/x/net/idna
golang.org/x/crypto/acme/autocert
github.com/labstack/echo

うまくいった!

おわり

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1