zoukankan      html  css  js  c++  java
  • vscode 配置go开发环境

    vscode 配置go开发环境

    安装vscode插件

    Visual Studio Code的配置选项支持Go插件的设置,可以通过用户偏好设置或workspace设置进行配置。在菜单File->Preferences处可以找到。

    安装go模块

    vscode 死活下不下来,只能自己去下载了

    go get -u -v github.com/nsf/gocode
    go get -u -v github.com/rogpeppe/godef
    go get -u -v github.com/golang/lint/golint
    go get -u -v github.com/lukehoban/go-find-references
    go get -u -v github.com/lukehoban/go-outline
    go get -u -v sourcegraph.com/sqs/goreturns
    go get -u -v golang.org/x/tools/cmd/gorename
    go get -u -v github.com/tpng/gopkgs
    go get -u -v github.com/newhook/go-symbols
    

    调试工具dlv debug下载

    https://github.com/go-delve/delve

    进入到gopath中,自己进行安装go install

    setting.json

    打开工作区的json文件,将下列内容复制进去

    {
            "http.proxy": "http://127.0.0.1:7890",
            "go.useLanguageServer": true,
            "go.autocompleteUnimportedPackages": true,   
            "timeline.excludeSources": [],
            "go.inferGopath": true,
            "go.gotoSymbol.includeImports": true,
            "go.useCodeSnippetsOnFunctionSuggest": true,
            "go.useCodeSnippetsOnFunctionSuggestWithoutType": true,
            "go.docsTool": "gogetdoc",
        
            "[go]": {
                "editor.snippetSuggestions": "none",
                "editor.formatOnSave": true,
                "editor.codeActionsOnSave": {
                    "source.organizeImports": true
                }
            },
            
            
            "files.eol": "
    ", // formatting only supports LF line endings
            "emmet.excludeLanguages": [
            
                "markdown"
            ],
            "go.addTags": {
            
            }
        }
    
  • 相关阅读:
    ElasticSearch工作原理
    prometheus监控es集群
    es索引调优
    ES中Refresh和Flush的区别
    网络服务器技术Apache与Nginx,IIS的不同
    shell里/dev/fd与/proc/self/fd的区别
    常用抓包工具
    Ubuntu Kubuntu Xubuntu Lubuntu Dubuntu Mythbuntu UbuntuBudgie区别
    Android的Looper.loop()消息循环机制
    申请读写sd卡权限shell
  • 原文地址:https://www.cnblogs.com/tomyyyyy/p/14105724.html
Copyright © 2011-2022 走看看