查看依赖库所有版本
bash
go list -m -versions github.com/spf13/cast
手动检查依赖树
bash
go mod why github.com/spf13/viper
查看指定版本库所依赖库的版本
bash
curl -s https://goproxy.cn/github.com/spf13/viper/@v/v1.18.0.mod | grep spf13/cast
查看所有依赖库
bash
curl -s https://goproxy.cn/github.com/spf13/viper/@v/v1.18.0.mod
go.mod替换依赖库
bash
go mod edit -replace github.com/spf13/viper=v1.16.0