[Go]解决 can't load package: cannot find module providing package github.com/xxxxx

当我执行go install github.com/xxxxx 时候 , 报错:

can't load package: cannot find module providing package github.com/xxx: working directory is not part of a module

使用的go module来解决依赖问题

执行一下

go mod init