• go环境安装


    1、在mac终端安装go

    在go 官方网站下载mac版本的go,安装完成后在中断运行go version和 go env确认go安装好了

    例如我的:

    alisadeMacBook-Pro:~ root# go version
    go version go1.15.3 darwin/amd64
    alisadeMacBook-Pro:~ root# go env
    GO111MODULE=""
    GOARCH="amd64"
    GOBIN=""
    GOCACHE="/var/root/Library/Caches/go-build"
    GOENV="/var/root/Library/Application Support/go/env"
    GOEXE=""
    GOFLAGS=""
    GOHOSTARCH="amd64"
    GOHOSTOS="darwin"
    GOINSECURE=""
    GOMODCACHE="/var/root/go/pkg/mod"
    GONOPROXY=""
    GONOSUMDB=""
    GOOS="darwin"
    GOPATH="/var/root/go"
    GOPRIVATE=""
    GOPROXY="https://proxy.golang.org,direct"
    GOROOT="/usr/local/Cellar/go/1.15.3/libexec"
    GOSUMDB="sum.golang.org"
    GOTMPDIR=""
    GOTOOLDIR="/usr/local/Cellar/go/1.15.3/libexec/pkg/tool/darwin_amd64"
    GCCGO="gccgo"
    AR="ar"
    CC="clang"
    CXX="clang++"
    CGO_ENABLED="1"
    GOMOD=""
    CGO_CFLAGS="-g -O2"
    CGO_CPPFLAGS=""
    CGO_CXXFLAGS="-g -O2"
    CGO_FFLAGS="-g -O2"
    CGO_LDFLAGS="-g -O2"
    PKG_CONFIG="pkg-config"
    GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build777133695=/tmp/go-build -gno-record-gcc-switches -fno-common"
    alisadeMacBook-Pro:~ root#

    2、下载安装vscode

    查看vscode版本,点击vscode软件左上角的visual studio code查看vscode的版本

     或者在帮助中relase note中查看

     

     3、在vscode 中查找setting.json并且配置一些参数,包括自动导入啊等等

    点击左侧的小齿轮,然后选setting

    其中Setting内容如下

    {
    "editor.suggestSelection": "first",
    "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
    "workbench.colorTheme": "One Monokai",
    "python.languageServer": "Microsoft",
    "python.pythonPath": "/usr/local/opt/python/bin/python3.7",
    "atomKeymap.promptV3Features": true,
    "editor.multiCursorModifier": "ctrlCmd",
    "editor.formatOnPaste": true,
    "editor.fontSize": 12,
    "editor.snippetSuggestions": "top",
    "terminal.integrated.shell.osx": "/bin/bash",
    "editor.codeActionsOnSave": { "source.organizeImports": true },
    "go.autocompleteUnimportedPackages": true,
    "go.gocodePackageLookupMode": "go",
    "go.gotoSymbol.includeImports": true,
    "go.useCodeSnippetsOnFunctionSuggest": true,
    "go.useCodeSnippetsOnFunctionSuggestWithoutType": true,
    "files.autoSave": "afterDelay",
    "go.alternateTools": {
    "files.autoSave": "off",
    "go.buildOnSave": true,
    "go.lintOnSave": true,
    "go.vetOnSave": true,
    "go.buildFlags": [],
    "go.lintFlags": [],
    "go.vetFlags": [],
    "go.coverOnSave": false,
    "go.useCodeSnippetsOnFunctionSuggest": false,
    "go.formatOnSave": true,
    "go.formatTool": "goreturns",
    "go.goroot": "/usr/local/go", //默认/usr/local/-->双引号中一般填写你的goroot路径
    "go.gopath": "/Users/mayan/golang_project",//-->一般填写你的gopath路径
    } //括号内地内容为新增加
    }
    4、安装完成后在桌面创建demo文件夹,在demo文件夹中创建main.go,然后在vscode中打开main.go开始写第一个程序
     
  • 相关阅读:
    sqlserver游标概念与实例全面解说
    Dos网络查看命令
    SQL Server和Access数据读写
    表中记录查询排序(设置排序规则)
    sql server中扩展存储过程
    sql server中分布式查询随笔(链接服务器(sp_addlinkedserver)和远程登录映射(sp_addlinkedsrvlogin)使用小总结)
    合并有数据的列
    防止用户同时使用一个存储过程
    (转载) 两个数据库比较 对比视图存储过程及表结构差异
    Sql Server REPLACE函数的使用
  • 原文地址:https://www.cnblogs.com/kissit/p/go.html
Copyright © 2020-2023  润新知