尝试过各种地址的excelize和tealeg/xlsx,都是直接go get 不行,然后clone下来后安装又提示golang里的文件缺失。
go版本:go version go1.17.8 windows/amd64
OS版本:Win11
命令:
```
git config --global url.git@github.com:.insteadOf https://github.com/
C:\Users\Gao\go\src\sorter>git clone https://gitclone.com/github.com/360EntSecGroup-Skylar/excelize
Cloning into 'excelize'...
remote: 对象计数中: 4932, 完成.
remote: 压缩对象中: 100% (2610/2610), 完成.
remote: Total 4932 (delta 3808), reused 3028 (delta 2305)Receiving objects: 100% (4932/4932), 3.46 MiB | 766.00 KiB/s
Receiving objects: 100% (4932/4932), 3.52 MiB | 768.00 KiB/s, done.
Resolving deltas: 100% (3808/3808), done.
```
go install 的时候提示如下:
```
excelize\crypt.go:31:2: cannot find package "golang.org/x/crypto/md4" in any of:
C:\Program Files\Go\src\golang.org\x\crypto\md4 (from $GOROOT)
C:\Users\Gao\go\src\golang.org\x\crypto\md4 (from $GOPATH)
excelize\crypt.go:32:2: cannot find package "golang.org/x/crypto/ripemd160" in any of:
C:\Program Files\Go\src\golang.org\x\crypto\ripemd160 (from $GOROOT)
C:\Users\Gao\go\src\golang.org\x\crypto\ripemd160 (from $GOPATH)
excelize\excelize.go:29:2: cannot find package "golang.org/x/net/html/charset" in any of:
C:\Program Files\Go\src\golang.org\x\net\html\charset (from $GOROOT)
C:\Users\Gao\go\src\golang.org\x\net\html\charset (from $GOPATH)
excelize\crypt.go:33:2: cannot find package "golang.org/x/text/encoding/unicode" in any of:
C:\Program Files\Go\src\golang.org\x\text\encoding\unicode (from $GOROOT)
C:\Users\Gao\go\src\golang.org\x\text\encoding\unicode (from $GOPATH)
```
发现目前github上也没有对应的这几个文件呢。
用以下几个命令都报错:
```
git clone https://gitclone.com/github/golang.org/x/crypto/md4
git clone https://gitclone.com/github/golang.org/x/crypto/ripemd160
git clone https://gitclone.com/github/golang.org/x/net/html/charset
git clone https://gitclone.com/github/golang.org/x/text/encoding/unicode
```
3楼 <a href="/user/yleoer" title="@yleoer">@yleoer</a> 报错呢:
```
C:\Users\Gao\go\src>go get github.com/xuri/excelize/v2
cannot find package "github.com/xuri/excelize/v2" in any of:
C:\Program Files\Go\src\github.com\xuri\excelize\v2 (from $GOROOT)
C:\Users\Gao\go\src\github.com\xuri\excelize\v2 (from $GOPATH)
```
但是C:\Users\Gao\go\src\github.com目录里确实新增了xuri和各种.go的文件和文件夹。
去掉v2版本号试了以下,报错如下:
```
C:\Users\Gao\go\src>go get github.com/xuri/excelize
package golang.org/x/net/html/charset: unrecognized import path "golang.org/x/net/html/charset": https fetch: Get "https:
//golang.org/x/net/html/charset?go-get=1": dial tcp 142.251.43.17: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/text/encoding/unicode: unrecognized import path "golang.org/x/text/encoding/unicode": https fetch: G
et "https://golang.org/x/text/encoding/unicode?go-get=1": dial tcp 142.251.43.17:443: connectex: A connection attempt fai
led because the connected party did not properly respond after a period of time, or established connection failed because
connected host has failed to respond.
```
#4