多尝试几次,ping 一下 github.com ,可能是被墙了,没办法,只能找代理了
运气好的话,就继续下去吧,否则请绕路
说明: 全局只有一个
事先声明,默认情况下,go get 是下载到 GOPATH (这是go的工作目录)的全局变量的目录下的
搞清楚这个目录后,方便后面使用,否则重新建立,但是记住,这个目录 全局只有一个
1️⃣ go get -v github.com/beego/bee
github.com/beego/bee (download)
github.com/beego/bee/vendor/gopkg.in/yaml.v2
github.com/beego/bee/logger/colors
github.com/beego/bee/vendor/github.com/lib/pq/oid
github.com/beego/bee/vendor/github.com/go-sql-driver/mysql
github.com/beego/bee/vendor/github.com/lib/pq
github.com/beego/bee/logger
github.com/beego/bee/vendor/github.com/derekparker/delve/dwarf/util
github.com/beego/bee/vendor/golang.org/x/debug/dwarf
github.com/beego/bee/vendor/github.com/derekparker/delve/dwarf/frame
github.com/beego/bee/config
github.com/beego/bee/vendor/github.com/derekparker/delve/dwarf/line
github.com/beego/bee/vendor/github.com/derekparker/delve/dwarf/op
github.com/beego/bee/utils
github.com/beego/bee/vendor/golang.org/x/sys/windows
github.com/beego/bee/vendor/rsc.io/x86/x86asm
github.com/beego/bee/vendor/github.com/derekparker/delve/dwarf/reader
github.com/beego/bee/cmd/commands
github.com/beego/bee/vendor/github.com/derekparker/delve/version
github.com/beego/bee/cmd/commands/version
github.com/beego/bee/vendor/github.com/derekparker/delve/config
github.com/beego/bee/vendor/github.com/mattn/go-isatty
github.com/beego/bee/cmd/commands/migrate
github.com/beego/bee/cmd/commands/bale
github.com/beego/bee/cmd/commands/beefix
github.com/beego/bee/vendor/github.com/derekparker/delve/proc
github.com/beego/bee/vendor/github.com/mattn/go-colorable
github.com/beego/bee/generate
github.com/beego/bee/vendor/github.com/peterh/liner
github.com/beego/bee/vendor/github.com/fsnotify/fsnotify
github.com/beego/bee/cmd/commands/dockerize
github.com/beego/bee/cmd/commands/api
github.com/beego/bee/vendor/github.com/astaxie/beego/swagger
github.com/beego/bee/vendor/github.com/astaxie/beego/utils
github.com/beego/bee/cmd/commands/hprose
github.com/beego/bee/cmd/commands/new
github.com/beego/bee/vendor/github.com/derekparker/delve/service/api
github.com/beego/bee/cmd/commands/pack
github.com/beego/bee/generate/swaggergen
github.com/beego/bee/cmd/commands/rs
github.com/beego/bee/vendor/github.com/derekparker/delve/service
github.com/beego/bee/vendor/github.com/derekparker/delve/service/debugger
github.com/beego/bee/vendor/github.com/gorilla/websocket
github.com/beego/bee/cmd/commands/server
github.com/beego/bee/cmd/commands/generate
github.com/beego/bee/vendor/github.com/derekparker/delve/service/rpc2
github.com/beego/bee/vendor/github.com/derekparker/delve/service/rpc1
github.com/beego/bee/vendor/github.com/derekparker/delve/terminal
github.com/beego/bee/cmd/commands/run
github.com/beego/bee/vendor/github.com/derekparker/delve/service/rpccommon
github.com/beego/bee/cmd/commands/dlv
github.com/beego/bee/cmd
github.com/beego/bee
进入到GOPATH的里面的bin目录下:
将bin目录路径添加到path环境变量下;
注:如果添加后导致go 命令不能使用,那就删了bee刚刚添加的bin路径,重启一下高级系统设置,然后再次添加(我的错误可能是由于使用 set path=F:\goPATH\bin cmd 命令不成功导致的)
查看bee 命令是否可以使用
F:\goPATH>bee
'bee' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
将bin目录路径添加到path环境变量下;
再次查看
F:\goPATH>bee
Bee is a Fast and Flexible tool for managing your Beego Web Application.
USAGE
bee command [arguments]
AVAILABLE COMMANDS
version Prints the current Bee version
migrate Runs database migrations
api Creates a Beego API application
bale Transforms non-Go files to Go source files
fix Fixes your application by making it compatible with newer versions of Beego
dlv Start a debugging session using Delve
dockerize Generates a Dockerfile for your Beego application
generate Source code generator
hprose Creates an RPC application based on Hprose and Beego frameworks
new Creates a Beego application
pack Compresses a Beego application into a single file
rs Run customized scripts
run Run the application by starting a local development server
server serving static content over HTTP on port
Use bee help [command] for more information about a command.
ADDITIONAL HELP TOPICS
Use bee help [topic] for more information about that topic.
F:\goPATH>go get -v github.com/astaxie/beego
github.com/astaxie/beego (download)
github.com/astaxie/beego/vendor/gopkg.in/yaml.v2
github.com/astaxie/beego/config
github.com/astaxie/beego/utils
github.com/astaxie/beego/logs
github.com/astaxie/beego/grace
github.com/astaxie/beego/session
github.com/astaxie/beego/toolbox
github.com/astaxie/beego/vendor/golang.org/x/crypto/acme
github.com/astaxie/beego/context
github.com/astaxie/beego/vendor/golang.org/x/crypto/acme/autocert
github.com/astaxie/beego/context/param
github.com/astaxie/beego
进入F:\goPATH\src下,执行bee new webApp
______
| ___ \
| |_/ / ___ ___
| ___ \ / _ \ / _ \
| |_/ /| __/| __/
\____/ \___| \___| v1.10.0
2018/12/08 22:56:37 INFO ▶ 0001 Creating application...
create F:\goPATH\src\webApp\
create F:\goPATH\src\webApp\conf\
create F:\goPATH\src\webApp\controllers\
create F:\goPATH\src\webApp\models\
create F:\goPATH\src\webApp\routers\
create F:\goPATH\src\webApp\tests\
create F:\goPATH\src\webApp\static\
create F:\goPATH\src\webApp\static\js\
create F:\goPATH\src\webApp\static\css\
create F:\goPATH\src\webApp\static\img\
create F:\goPATH\src\webApp\views\
create F:\goPATH\src\webApp\conf\app.conf
create F:\goPATH\src\webApp\controllers\default.go
create F:\goPATH\src\webApp\views\index.tpl
create F:\goPATH\src\webApp\routers\router.go
create F:\goPATH\src\webApp\tests\default_test.go
create F:\goPATH\src\webApp\main.go
2018/12/08 22:56:37 SUCCESS ▶ 0002 New application successfully created!
进入F:\goPATH\src下,直接执行bee run webApp(不好,出问题了)
F:\goPATH\src>bee run webapp
______
| ___ \
| |_/ / ___ ___
| ___ \ / _ \ / _ \
| |_/ /| __/| __/
\____/ \___| \___| v1.10.0
2018/12/09 13:08:35 INFO ▶ 0001 Using 'webapp' as 'appname'
2018/12/09 13:08:35 INFO ▶ 0002 Initializing watcher...
can't load package: package .: no Go files in F:\goPATH\src
2018/12/09 13:08:36 ERROR ▶ 0003 Failed to build the application: can't load package: package .: no Go files in F:\goPATH\src
bee run
任何参数都不需要加F:\goPATH\src\webapp>bee run
______
| ___ \
| |_/ / ___ ___
| ___ \ / _ \ / _ \
| |_/ /| __/| __/
\____/ \___| \___| v1.10.0
2018/12/09 12:55:33 INFO ▶ 0001 Using 'webapp' as 'appname'
2018/12/09 12:55:33 INFO ▶ 0002 Initializing watcher...
2018/12/09 12:55:36 SUCCESS ▶ 0003 Built Successfully!
2018/12/09 12:55:36 INFO ▶ 0004 Restarting 'webapp.exe'...
2018/12/09 12:55:36 SUCCESS ▶ 0005 './webapp.exe' is running...
2018/12/09 12:55:38.098 [I] [asm_amd64.s:2337] http server Running on http://:8080
[beego] 2018/12/09 - 12:55:56 | ::1| 200 | 19.9616ms| match| GET / r:/
[beego] 2018/12/09 - 12:55:57 | ::1| 304 | 499.6µs| match| GET /static/js/reload.min.js
复制 localhost:8080到地址栏, 查看到如下结果,标明OK