[---] go help
2. Freenode IRC, #go-nuts http://freenode.net/ [---]
[---] 1. download https://code.google.com/p/go/wiki/Downloads?tm=2
2. extract `tar -C /usr/local -xzf go$VERSION.$OS-$ARCH.tar.gz`
3. in ~/.bashrc, insert: export PATH=$PATH:/usr/local/go/bin
4. create a sample app and compile `go run hello.go` [---]
[---] set -o nounset set -o errexit set -o pipefail
go build -o apptranslator_app *.go ./apptranslator_app [---]
[---] @@@ hello.go: package main
import "fmt"
func main() { fmt.Printf("Hello, world.\n") } [---]
[---] 1. for row := range bigDigits[0] { - is same as - for row := 0; row < len(bigDigits[0]); row++ {
2. infinite loop for {
/// run forever
} [---]
[---] import "container/list" for e := l.Front(); e != nil; e = e.Next() { // do something with e.Value } [---]
[---]
[---]
[---] func make([]T, len, cap) []T
- length and capacity len(s) == 5 cap(s) == 5
Title: slicing - Slicing does not copy the slice's data. - It creates a new slice value that points to the original array.
type sliceHeader struct {
Length int ZerothElement *byte
}
slice := sliceHeader{
Length: 50, ZerothElement: &buffer[100],
} [---]
[---] s += "adfa" + " another "
[---]
[---] t := strconv.Itoa(123) [---]
[---] out, err := exec.Command("sh","-c",cmd).Output()
[---]