教程集 www.jiaochengji.com
教程集 >  Golang编程  >  golang教程  >  正文 解决 Failed to install golang.org/x/crypto/bcrypt 问题

解决 Failed to install golang.org/x/crypto/bcrypt 问题

发布时间:2022-01-11   编辑:jiaochengji.com
教程集为您提供解决 Failed to install golang.org/x/crypto/bcrypt 问题等资源,欢迎您收藏本站,我们将为您提供最新的解决 Failed to install golang.org/x/crypto/bcrypt 问题资源
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;"><path stroke-linecap="round" d="M5,0 0,2.5 5,5z" id="raphael-marker-block" style="-webkit-tap-highlight-color: rgba(0, 0, 0, 0);"/></svg>

最近在用<code>beego</code>写demo,期间遇到一个问题:

<pre><code class="lang-go hljs"><span class="token keyword">import</span> <span class="token punctuation">(</span> <span class="token operator">...</span> <span class="token string">"golang.org/x/crypto/scrypt"</span> <span class="token operator">...</span> <span class="token punctuation">)</span> </code></pre>

在引入<code>scrypt</code>报错:

<pre><code class="lang-shell hljs">get -t -v golang.org/x/crypto/scrypt/<span class="token punctuation">..</span>. Fetching https://golang.org/x/crypto/scrypt?go-get<span class="token operator">=</span>1 https fetch failed: Get https://golang.org/x/crypto/scrypt?go-get<span class="token operator">=</span>1: dial tcp 216.239.37.1:443: connectex: 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. package golang.org/x/crypto/scrypt/<span class="token punctuation">..</span>.: unrecognized <span class="token function">import</span> path <span class="token string">"golang.org/x/crypto/scrypt"</span> <span class="token punctuation">(</span>https fetch: Get https://golang.org/x/crypto/scrypt?go-get<span class="token operator">=</span>1: dial tcp 216.239.37.1:443: connectex: 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.<span class="token punctuation">)</span> </code></pre>

解决办法是:
在<code>$GOPATH/src/</code>目录下创建<code>golang.org/x/</code>目录,如果是windows系统可以使用<code>Git</code>命令窗口来完成。

<pre><code class="lang-shell hljs"><span class="token function">mkdir</span> -p <span class="token variable">$GOPATH</span>/src/golang.org/x/ </code></pre>

然后从github拉取<code>golang.org/x/crypto/bcrypt</code>

<pre><code class="lang-shell hljs"><span class="token function">cd</span> <span class="token variable">$GOPATH</span>/src/golang.org/x/ <span class="token function">git</span> clone git@github.com:golang/crypto.git </code></pre>

操作示例:


参考:
https://stackoverflow.com/questions/31334197/failed-to-install-golang-org-x-crypto-bcrypt

到此这篇关于“解决 Failed to install golang.org/x/crypto/bcrypt 问题”的文章就介绍到这了,更多文章或继续浏览下面的相关文章,希望大家以后多多支持JQ教程网!

您可能感兴趣的文章:
解决 Failed to install golang.org/x/crypto/bcrypt 问题
go mod使用
Golang微服务micro 环境搭建,纯小白..
Go Web 编程--使用 bcrpyt 哈希用户密码
golang 包管理工具
GOPROXY:解决 go get golang.org/x 包失败
Windows10 golang gRPC环境搭建
golang基础教程(附录一)Golang代理配置,解决google包无法下载的问题
golang使用bcrypt加密算法进行密码的加密与校验
解决:failed to open stream: No such file or directory in

[关闭]
~ ~