Playing around with Go by doing a simple wiki tutorial and extending upon it a bit.
-
Setup Go Project directories
/your-go-path/bin /your-go-path/pkg /your-go-path/src
-
Define your path variables in
~/.profile
export GOPATH=/your-go-path export PATH=$PATH:$HOME/your-go-path/bin
-
Restart bash or run
source ~.profile
-
Clone gowiki src into
/your-go-path/src
directorygit clone [email protected]:broox/go-wiki.git
-
Create MySQL DB called
gowiki
with the following schema.create table `pages` ( `id` int(11) NOT NULL AUTO_INCREMENT, `title` varchar(100), `body` text, `created_at` datetime, `updated_at` datetime, primary key (`id`) );
-
Install some dependencies
go get github.com/go-sql-driver/mysql go get github.com/gorilla/pat
-
Build the project via
go build gowiki
-
Run the application via
gowiki