亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

Go lang 環境和路徑

Go lang 環境和路徑

Go
慕村9548890 2022-03-03 19:49:00
我從 github 克隆的應用程序很少,但不確定我是否做對了所有事情。我最近安裝了go。$ goGo is a tool for managing Go source code.Usage:        go command [arguments]The commands are:        build       compile packages and dependencies        clean       remove object files        doc         show documentation for package or symbol        env         print Go environment information        fix         run go tool fix on packages        fmt         run gofmt on package sources        generate    generate Go files by processing source        get         download and install packages and dependencies        install     compile and install packages and dependencies        list        list packages        run         compile and run Go program        test        test packages        tool        run specified go tool        version     print Go version        vet         run go tool vet on packagesUse "go help [command]" for more information about a command.Additional help topics:        c           calling between Go and C        buildmode   description of build modes        filetype    file types        gopath      GOPATH environment variable        environment environment variables        importpath  import path syntax        packages    description of package lists        testflag    description of testing flags        testfunc    description of testing functionsUse "go help [topic]" for more information about that topic.而且我已經相應配置了一些東西(導出的變量等。)也將它們添加到 ~/.bashrc 但是我仍然需要更改目錄并轉到我的 go/bin 文件夾。這是所有正在做的事情還是我可以做的事情改變。如果您能在某種文檔上指出我,那就太好了(請不要去朗讀?。?。我在 Mac OS X 上。
查看完整描述

2 回答

?
千萬里不及你

TA貢獻1784條經驗 獲得超9個贊

驗證您嘗試運行的二進制文件是否在您的$GOPATH/bin目錄中,例如它應該在您運行時出現ls $GOPATH/bin

接下來,驗證它$GOPATH/bin是否在您的 中$PATH,例如它應該與 一起出現echo $PATH。如果這$GOPATH/bin不在您的 中$PATH,請添加它,例如export PATH=$GOPATH/bin:$PATH(您可能希望將其添加到您的 中.bashrc)。


查看完整回答
反對 回復 2022-03-03
?
繁星淼淼

TA貢獻1775條經驗 獲得超11個贊

在 Mac OS X 中,打開終端

創建一個 .profile 文件

touch .profile

編輯它

vim .profile

將此添加到您的第一行

export GOPATH=$HOME/work/或您的 Go 文件所在的任何目錄

保存:w并退出:q

重啟終端

切換到新的 GOPATH/bin 目錄以確認

cd $GOPATH/bin


查看完整回答
反對 回復 2022-03-03
  • 2 回答
  • 0 關注
  • 181 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號