我是靠谱客的博主 感动板凳,这篇文章主要介绍go mod 的使用,现在分享给大家,希望可以做个参考。

详见:https://blog.csdn.net/chushoufengli/article/details/93367603?ops_request_misc=%7B%22request%5Fid%22%3A%22158228426819725222418885%22%2C%22scm%22%3A%2220140713.130056874..%22%7D&request_id=158228426819725222418885&biz_id=0&utm_source=distribute.pc_search_result.none-task

 

go mod tidy 

goland 还是报红的话 goland Preference->Go->Go Modules(vgo) -> Enable Go Modules(vgo)intergration


jrw@wangfy:~/code/community/article$ go mod
Go mod provides access to operations on modules.

Note that support for modules is built into all the go commands,
not just 'go mod'. For example, day-to-day adding, removing, upgrading,
and downgrading of dependencies should be done using 'go get'.
See 'go help modules' for an overview of module functionality.

Usage:

        go mod <command> [arguments]

The commands are:

        download    download modules to local cache
        edit        edit go.mod from tools or scripts
        graph       print module requirement graph
        init        initialize new module in current directory
        tidy        add missing and remove unused modules
        vendor      make vendored copy of dependencies
        verify      verify dependencies have expected content
        why         explain why packages or modules are needed

Use "go help mod <command>" for more information about a command.

GO111MODULE=on

export GOPROXY=https://goproxy.io

sudo chmod -R 777  /工作目录 (-R:是指几连医用到目录里所有子目录和文件;777:是指所有用户都拥有的最高权限)

go mod tidy

最后

以上就是感动板凳最近收集整理的关于go mod 的使用的全部内容,更多相关go内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(57)

评论列表共有 0 条评论

立即
投稿
返回
顶部