Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
xujihui1985 committed Aug 14, 2018
1 parent 70e8f91 commit 52607ea
Showing 1 changed file with 42 additions and 1 deletion.
43 changes: 42 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,45 @@
learninggo
==========

a playground to learn golang
### Setup go developing environment

#### install golang

[download from here](https://golang.org/dl/)

#### setup GOPATH and GOROOT env

```
export GOPATH=$HOME/code/go
export PATH=$GOPATH/bin:$PATH
```

`$GOPATH` is where you put all of your go code


#### initialize gopath

```
mkdir -p $GOPATH/{bin,pkg,src}
```

congratulation, you are good to go

#### run your hello world

```
mkdir -p $GOPATH/src/hellogo
cat > $GOPATH/src/hellogo/main.go <<EOF
package main
import "fmt"
func main() {
fmt.Println("hello world")
}
EOF
``
go run $GOPATH/src/hellogo/main.go

0 comments on commit 52607ea

Please sign in to comment.