劉月林 | 關於Golang 環境搭建成功案例

來源:互聯網
上載者:User

go.gif
liuyuelin@liuyuelindeMacBook-Pro ⮀ ~ ⮀ brew install goUpdating Homebrew…^C⇒ Downloading [https://homebrew.bintray.com/bottles/go-1.10.3.sierra.bottle.tar.g](https://homebrew.bintray.com/bottles/go-1.10.3.sierra.bottle.tar.g)###### ################################################################## 100.0%⇒ Pouring go-1.10.3.sierra.bottle.tar.gz⇒ CaveatsA valid GOPATH is required to use the `go get` command.If $GOPATH is not specified, $HOME/go will be used by default:[https://golang.org/doc/code.html#GOPATH](https://golang.org/doc/code.html#GOPATH)You may wish to add the GOROOT-based install location to your PATH:export PATH=[圖片上傳失敗...(image-48625e-1532350472293)]{PATH}”liuyuelin@liuyuelindeMacBook-Pro ⮀ ~ ⮀ export PATHliuyuelin@liuyuelindeMacBook-Pro ⮀ ~ ⮀ source ~/.bash_profileliuyuelin@liuyuelindeMacBook-Pro ⮀ ~ ⮀ go get github.com/beego/bee^[[A^C✘ liuyuelin@liuyuelindeMacBook-Pro ⮀ ~ ⮀ go get github.com/beego/beeliuyuelin@liuyuelindeMacBook-Pro ⮀ ~ ⮀ go get github.com/astaxie/beego^C✘ liuyuelin@liuyuelindeMacBook-Pro ⮀ ~ ⮀ go get github.com/astaxie/beegoliuyuelin@liuyuelindeMacBook-Pro ⮀ ~ ⮀ cd go/srcliuyuelin@liuyuelindeMacBook-Pro ⮀ ~/go/src ⮀ bee run quicstart2018/07/23 20:25:41 ERROR  0001 You need to set GOPATH environment variable* * *| ***\| |*/ / _**  ***|***\ / *\ / *\| |*/ /| **/| **/_**_/ \***| ___| v1.10.02018/07/23 20:25:41 FATAL  0002 GOPATH environment variable is not set or empty✘ liuyuelin@liuyuelindeMacBook-Pro ⮀ ~/go/src ⮀ cd ..liuyuelin@liuyuelindeMacBook-Pro ⮀ ~/go ⮀ cd ..liuyuelin@liuyuelindeMacBook-Pro ⮀ ~ ⮀ ls2+3*4 Movies get-pip.pyApplications Music goCreative Cloud Files Pictures helloWorldDesktop Public nofly.txtDocuments abc.txt oddIndex.mDownloads bcaon.txt simpson.mFLUSH eclipse styles.lessIdeaProjects eclipse-workspace 百度雲同步盤Library first_appliuyuelin@liuyuelindeMacBook-Pro ⮀ ~ ⮀ cd goliuyuelin@liuyuelindeMacBook-Pro ⮀ ~/go ⮀ lsbin pkg srcliuyuelin@liuyuelindeMacBook-Pro ⮀ ~/go ⮀ cd ..liuyuelin@liuyuelindeMacBook-Pro ⮀ ~ ⮀ go get github.com/beego/beeliuyuelin@liuyuelindeMacBook-Pro ⮀ ~ ⮀ go get github.com/astaxie/beegoliuyuelin@liuyuelindeMacBook-Pro ⮀ ~ ⮀ cd goliuyuelin@liuyuelindeMacBook-Pro ⮀ ~/go ⮀ cd binliuyuelin@liuyuelindeMacBook-Pro ⮀ ~/go/bin ⮀ lsbeeliuyuelin@liuyuelindeMacBook-Pro ⮀ ~/go/bin ⮀ cd ..liuyuelin@liuyuelindeMacBook-Pro ⮀ ~/go ⮀ cd pkgliuyuelin@liuyuelindeMacBook-Pro ⮀ ~/go/pkg ⮀ lsdarwin_amd64liuyuelin@liuyuelindeMacBook-Pro ⮀ ~/go/pkg ⮀ cd ..liuyuelin@liuyuelindeMacBook-Pro ⮀ ~/go ⮀ cs srczsh: command not found: cs✘ liuyuelin@liuyuelindeMacBook-Pro ⮀ ~/go ⮀ cd srcliuyuelin@liuyuelindeMacBook-Pro ⮀ ~/go/src ⮀ lsgithub.com golang.org gopkg.inliuyuelin@liuyuelindeMacBook-Pro ⮀ ~/go/src ⮀ cd ..liuyuelin@liuyuelindeMacBook-Pro ⮀ ~/go ⮀ cd ..liuyuelin@liuyuelindeMacBook-Pro ⮀ ~ ⮀ go get github.com/beego/beeliuyuelin@liuyuelindeMacBook-Pro ⮀ ~ ⮀ man beegoNo manual entry for beego✘ liuyuelin@liuyuelindeMacBook-Pro ⮀ ~ ⮀ go get github.com/beego/beeliuyuelin@liuyuelindeMacBook-Pro ⮀ ~ ⮀ go get github.com/beego/beeliuyuelin@liuyuelindeMacBook-Pro ⮀ ~ ⮀ go get github.com/astaxie/beegoliuyuelin@liuyuelindeMacBook-Pro ⮀ ~ ⮀ cd go/srcliuyuelin@liuyuelindeMacBook-Pro ⮀ ~/go/src ⮀ bee run quicstart2018/07/23 20:28:47 ERROR  0001 You need to set GOPATH environment variable* * *| ***\| |*/ / _**  ***|***\ / *\ / *\| |*/ /| **/| **/_**_/ \***| ___| v1.10.02018/07/23 20:28:47 FATAL  0002 GOPATH environment variable is not set or empty✘ liuyuelin@liuyuelindeMacBook-Pro ⮀ ~/go/src ⮀ echo $PATH”/Users/liuyuelin/.npm-global/bin/:/Users/liuyuelin/go/bin:/Users/liuyuelin/.npm-global/bin:/Users/liuyuelin/.rvm/gems/ruby-2.3.3/bin:/Users/liuyuelin/.rvm/gems/ruby-2.3.3@global/bin:/Users/liuyuelin/.rvm/rubies/ruby-2.3.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/liuyuelin/.rvm/bin”liuyuelin@liuyuelindeMacBook-Pro ⮀ ~/go/src ⮀ echo $GOPATHliuyuelin@liuyuelindeMacBook-Pro ⮀ ~/go/src ⮀ pwd/Users/liuyuelin/go/srcliuyuelin@liuyuelindeMacBook-Pro ⮀ ~/go/src ⮀ export GOPATH=/Users/liuyuelin/goliuyuelin@liuyuelindeMacBook-Pro ⮀ ~/go/src ⮀ echo $GOPATH/Users/liuyuelin/goliuyuelin@liuyuelindeMacBook-Pro ⮀ ~/go/src ⮀ bee run quicstart* * *| ***\| |*/ / _**  ***|***\ / *\ / *\| |*/ /| **/| **/_**_/ \***| ___| v1.10.02018/07/23 20:41:29 FATAL  0001 No application ‘quicstart’ found in your GOPATH✘ liuyuelin@liuyuelindeMacBook-Pro ⮀ ~/go/src ⮀ bee new quickstarte* * *| ***\| |*/ / _**  ***|***\ / *\ / *\| |*/ /| **/| **/_**_/ \***| ___| v1.10.02018/07/23 20:44:54 INFO  0001 Creating application…create /Users/liuyuelin/go/src/quickstarte/create /Users/liuyuelin/go/src/quickstarte/conf/create /Users/liuyuelin/go/src/quickstarte/controllers/create /Users/liuyuelin/go/src/quickstarte/models/create /Users/liuyuelin/go/src/quickstarte/routers/create /Users/liuyuelin/go/src/quickstarte/tests/create /Users/liuyuelin/go/src/quickstarte/static/create /Users/liuyuelin/go/src/quickstarte/static/js/create /Users/liuyuelin/go/src/quickstarte/static/css/create /Users/liuyuelin/go/src/quickstarte/static/img/create /Users/liuyuelin/go/src/quickstarte/views/create /Users/liuyuelin/go/src/quickstarte/conf/app.confcreate /Users/liuyuelin/go/src/quickstarte/controllers/default.gocreate /Users/liuyuelin/go/src/quickstarte/views/index.tplcreate /Users/liuyuelin/go/src/quickstarte/routers/router.gocreate /Users/liuyuelin/go/src/quickstarte/tests/default_test.gocreate /Users/liuyuelin/go/src/quickstarte/main.go2018/07/23 20:44:54 SUCCESS  0002 New application successfully created!liuyuelin@liuyuelindeMacBook-Pro ⮀ ~/go/src ⮀ bee run quicstart* * *| ***\| |*/ / _**  ***|***\ / *\ / *\| |*/ /| **/| **/_**_/ \***| ___| v1.10.02018/07/23 20:45:00 FATAL  0001 No application ‘quicstart’ found in your GOPATH✘ liuyuelin@liuyuelindeMacBook-Pro ⮀ ~/go/src ⮀ bee run quickstarte* * *| ***\| |*/ / _**  ***|***\ / *\ / *\| |*/ /| **/| **/_**_/ \***| ___| v1.10.02018/07/23 20:45:37 INFO  0001 Using ‘quickstarte’ as ‘appname’2018/07/23 20:45:37 INFO  0002 Initializing watcher…quickstarte/controllersquickstarte/routersquickstarte2018/07/23 20:45:39 SUCCESS  0003 Built Successfully!2018/07/23 20:45:39 INFO  0004 Restarting ‘quickstarte’…2018/07/23 20:45:39 SUCCESS  0005 ‘./quickstarte’ is running…2018/07/23 20:45:39.738 [I] [asm_amd64.s:2361] http server Running on [http://:8080](http://:8080/)2018/07/23 20:46:32.926 [D] [server.go:2694] | ::1| 200 | 1.7958ms| match| GET / r:/2018/07/23 20:46:32.956 [D] [server.go:2694] | ::1| 200 | 175.803µs| match| GET /static/js/reload.min.js2018/07/23 20:46:32.987 [D] [server.go:2694] | ::1| 404 | 375.565µs| nomatch| GET /favicon.ico

錯誤原因:
1+設定$GOPATH
2+沒有建立項目
3+項目名稱打錯

劉月林
寫於湖北沙洋
2018/07/23

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.