go 语言

安装

修改windows环境变量

export GOROOT=~/go
export GOBIN=$GOROOT/bin
export PATH=$PATH:$GOBIN
export GOPATH=/ideas/go

go easy portal

安装

  • State "DONE" from "OKTODAY" [2014-03-31 一 15:54]
  • State "OKTODAY" from "STARTED" [2014-03-31 一 15:54]
  • State "OKTODAY" from "STARTED" [2014-03-31 一 14:49]
  • State "OKTODAY" from "STARTED" [2014-03-31 一 14:02]
sudo yum install -y golang
#wget -c https://go.googlecode.com/files/go1.2.1.linux-amd64.tar.gz

设置gopath

编辑 .bashrc 文件

export GOPATH=/home/will/mygo
export PATH=$GOPATH/bin:$PATH

beego

go get  github.com/beego/bee
go get -v -u github.com/mattn/go-sqlite3
go get -v -u github.com/nsf/gocode

创建项目

  • State "DONE" from "OKTODAY" [2014-04-01 二 11:20]
  • State "OKTODAY" from "STARTED" [2014-04-01 二 10:08]
  • State "OKTODAY" from "STARTED" [2014-04-01 二 09:31]
  • State "OKTODAY" from "STARTED" [2014-04-01 二 09:03]
cd $GOPATH/src
bee new go-easy-portal
# https://help.github.com/articles/create-a-repo
cd go-easy-portal
git init
[will@localhost go-easy-portal]$ git add conf
[will@localhost go-easy-portal]$ git add controllers/
[will@localhost go-easy-portal]$ git add main.go
[will@localhost go-easy-portal]$ git add routers/
[will@localhost go-easy-portal]$ git add tests/
[will@localhost go-easy-portal]$ git add views/
[will@localhost go-easy-portal]$ git status
git commit -a -m "init version"
git remote add origin https://github.com/standino/go-easy-portal
git pull origin master
git commit -a -m "init version"
git push origin master

git remote add -f jquery-ui-portlet https://github.com/standino/jquery-ui-portlet.git
git subtree add --prefix=static/jquery-ui-portlet jquery-ui-portlet master --squash

git remote add -f FCBKcomplete https://github.com/standino/FCBKcomplete.git
git subtree add --prefix=static/FCBKcomplete FCBKcomplete master --squash

git remote add -f bootstrap-datetimepicker https://github.com/standino/bootstrap-datetimepicker.git
git subtree add --prefix=static/bootstrap-datetimepicker bootstrap-datetimepicker master --squash

git remote add -f iCheck https://github.com/standino/iCheck.git
git subtree add --prefix=static/iCheck iCheck master --squash

git remote add -f bootstrap-calendar https://github.com/standino/bootstrap-calendar.git
git subtree add --prefix=static/bootstrap-calendar bootstrap-calendar master --squash

git remote add -f bootstrap-paginator https://github.com/standino/bootstrap-paginator.git
git subtree add --prefix=static/bootstrap-paginator bootstrap-paginator master --squash

git remote add -f bootstrap-select https://github.com/standino/bootstrap-select.git
git subtree add --prefix=static/bootstrap-select bootstrap-select master --squash

git remote add -f angular-ui-dashboard https://github.com/nickholub/angular-ui-dashboard
git subtree add --prefix=static/angular-ui-dashboard angular-ui-dashboard master --squash


git remote add -f angular-dashboard-app https://github.com/nickholub/angular-dashboard-app
git subtree add --prefix=static/angular-dashboard-app angular-dashboard-app master --squash

git remote add -f d3 https://github.com/standino/d3
git subtree add --prefix=static/d3 d3 master

git remote add -f angular-d3-demo https://github.com/standino/angular-d3-demo.git
git subtree add --prefix=static/angular-d3-demo angular-d3-demo master

sqlite db

orm.RegisterDataBase("db2", "sqlite3", "data.db")

部署

linux

在 linux 下面部署,我们可以利用 nohup 命令,把应用部署在后端,如下所示:

nohup ./beepkg & 这样你的应用就跑在了 Linux 系统的守护进程

Comments

comments powered by Disqus