美文网首页开源工具技巧程序员
Mac VSCode Golang开发环境配置

Mac VSCode Golang开发环境配置

作者: piscesDreamCod | 来源:发表于2017-11-17 16:19 被阅读89次

    1. https://golang.org/dl/ 选择pkg自动安装包,然后在.bash_profile中配置自定义的GOPATH

        eg:

            export GOROOT=/usr/local/go

            export GOPATH=/Users/lz/GoglandProjects    

            export PATH=$PATH:$GOROOT/bin:/usr/local/git/bin

            export GOBIN=$GOPATH/bin

            export PATH=$PATH:$GOBIN

    2.执行命令

            mkdir -p $GOPATH/src/golang.org/x&&cd $GOPATH/src/golang.org/x&& git init && go get           github.com/derekparker/delve/cmd/dlv && go get github.com/kardianos/govendor&&git clone                 https://github.com/golang/tools.git

    3.进入VSCode,新建一个main.go文件,根据提示点击installAll,安装静态解析库 ,等待安装完成。

    note:(第一次进入需要配置VSCode)

    4.调试运行部分,如果报错出现

    couldnotlaunchprocess: exec:"lldb-server": executablefilenotfoundin$PATHProcessexiting 执行命令: xcode-select--install

    相关文章

      网友评论

        本文标题:Mac VSCode Golang开发环境配置

        本文链接:https://www.haomeiwen.com/subject/oepjvxtx.html