Skip to content

Instantly share code, notes, and snippets.

@otiai10
Last active December 23, 2015 06:49
Show Gist options
  • Save otiai10/6596982 to your computer and use it in GitHub Desktop.
Save otiai10/6596982 to your computer and use it in GitHub Desktop.
install Go into Debian squeeze 32bit and install revel

install mercurial (hg)

% sudo apt-get install mercurial

bind GOROOT and export GOPATH

# {{{ GO
export GOROOT=$HOME/go # goコマンドへのパス/bin (exportせずとも、PATHへのバインドさえすれば良い気もする) る)
export GOPATH=$HOME/go/.packages # go get でインストールしてくるパッケージへのパス/bin/bin
# こっちはgo getするときに参照されるので、exportする必要有り
# }}}

export PATH=/usr/local/bin:$CABAL_PATH:$NPM_PATH:$NODE_PATH:$GOROOT/bin:$GOPATH/bin:~/bin:$PATH

install go

wget appropriate sourcecode from go.google.com according to your CPU and OS command bit -> http://d.hatena.ne.jp/sakurako_s/20100714/1279118139

% wget wget https://go.googlecode.com/files/go1.1.2.linux-386.tar.gz
% tar -xzf go1.1.2.linux-386.tar.gz
% cd go/src
% ./all.bash
...
ALL TESTS PASSED

---
Installed Go for linux/386 in /home/otiai10/go
Installed commands in /home/otiai10/go/bin

install revel

% go get github.com/robfig/revel/revel

and revel command will be installed in $GOPATH/bin/

run sample revel app

revel run github.com/robfig/revel/samples/chat

これどこ参照してんの?

[3:04:45] % tree $GOPATH/src/github.com/robfig/revel/samples/chat
/home/hiromu/go/.packages/src/github.com/robfig/revel/samples/chat
|-- app
|   |-- chatroom
|   |   `-- chatroom.go
|   |-- controllers
|   |   |-- app.go
|   |   |-- longpolling.go
|   |   |-- refresh.go
|   |   `-- websocket.go
|   |-- routes
|   |   `-- routes.go
|   |-- tmp
|   |   `-- main.go
|   `-- views
|       |-- Application
|       |   `-- Index.html
|       |-- LongPolling
|       |   `-- Room.html
|       |-- Refresh
|       |   `-- Room.html
|       |-- WebSocket
|       |   `-- Room.html
|       |-- footer.html
|       `-- header.html
|-- conf
|   |-- app.conf
|   `-- routes
|-- public
|   |-- images
|   |   `-- favicon.png
|   |-- javascripts
|   |   |-- jquery-1.5.min.js
|   |   |-- jquery.scrollTo-min.js
|   |   `-- templating.js
|   `-- stylesheets
|       `-- main.css
`-- tests
    `-- apptest.go

16 directories, 21 files

ここや

run your sample

% mkdir ~/prj/go/revel/hello
% cd ~/prj/go/revel/hello
% 
@otiai10
Copy link
Author

otiai10 commented Sep 28, 2013

いやちがう。$GOPATH/src/hogehoge/app/controllers/app.goだわ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment