VSCode調試部分代碼時,報錯,提示不能自動擷取Models。報錯資訊如下。
go: golang.org/x/[email protected]: unrecognized import path "golang.org/x/crypto" (https fetch: Get https://golang.org/x/crypto?go-get=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.)
![](https://img.laitimes.com/img/9ZDMuAjOiMmIsIjOiQnIsIyZuBnLzUzN5cTM0kTNtITN4QDNzETNxAjMzATOxAjMtgjMyADO38CXzATOxAjMvwFOyIDM4czLcd2bsJ2Lc12bj5ycn9Gbi52YugTMwIzZtl2Lc9CX6MHc0RHaiojIsJye.png)
其中的一個解決方案如下:
step 1 進入go 預設安裝路徑下的src檔案;
step 2 點選Git Bash Here
step 3 登入網址 https://github.com/golang 去找 crypto 包的githum 位址
Step 4 通過git clone 指令下載下傳
git clone https://github.com/golang/crypto.git golang.org/x/crypto
step 5 下載下傳成功
VSCode 再次打開,不再報錯。