美文网首页
Go环境搭建和Goland

Go环境搭建和Goland

作者: Caesar_emperor | 来源:发表于2019-08-09 10:14 被阅读0次

    Linux 配置Go环境

    1.下载安装包并解压(可以不用命令行)

    2.找到.bashrc的隐藏文件(文件在home下面),在最下面加上:

    配置workspace
    export GOPATH=/home/liyuzhe/gopath/..(路径自己选择, 用来放以后自己的代码的目录,官方的GO会到root里面,即path调用)

    配置Goroot:
    export PATH=$PATH:/home/liyuzhe/go/bin

    =》保存
    3.检查配置情况

    go env或go version


    Goland环境配置

    1.在settings设置页面配置
    **这里GoPath推荐使用创建的整个工程路径

    2.DeBug setting配置

    选择Gobuild, Run Kind 需选择Package,不能选择File.
    Package path 需设置成main包的目录名,在这里它名为main.
    Working directory 需要设置成该项目的src目录路径.
    Output directory 设置为项目目录的bin目录.


    Smartgit配置

    1.打开网址https://git.lbx.dev/LBX/QA-API,复制仓库的https url
    2.打开smartgit,点击Repository->clone->粘贴刚才的url,继续下一步,自己创建文件夹用来放克隆下来的项目代码->然后就ok了,等待克隆完成

    ****
    linux exec: "gcc": executable file not found in $PATH的问题

    >sudo apt-get install build-essential

    检查是否安装
    >gcc --version

    相关文章

      网友评论

          本文标题:Go环境搭建和Goland

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