diff --git a/2015/06-devnation-golang-good-bad-ugly/README.md b/2015/06-devnation-golang-good-bad-ugly/README.md deleted file mode 100644 index 719f863..0000000 --- a/2015/06-devnation-golang-good-bad-ugly/README.md +++ /dev/null @@ -1,6 +0,0 @@ -Usage -==== - - go get golang.org/x/tools/cmd/present - present . - diff --git a/2015/06-devnation-golang-good-bad-ugly/README.md b/2015/06-devnation-golang-good-bad-ugly/README.md new file mode 120000 index 0000000..eb06b37 --- /dev/null +++ b/2015/06-devnation-golang-good-bad-ugly/README.md @@ -0,0 +1 @@ +../02-devconf.cz/README.md \ No newline at end of file diff --git a/2015/06-devnation-golang-good-bad-ugly/cats20.gif b/2015/06-devnation-golang-good-bad-ugly/cats20.gif deleted file mode 100644 index b6c353a..0000000 Binary files a/2015/06-devnation-golang-good-bad-ugly/cats20.gif and /dev/null differ diff --git a/2015/06-devnation-golang-good-bad-ugly/cats20.gif b/2015/06-devnation-golang-good-bad-ugly/cats20.gif new file mode 120000 index 0000000..3891616 --- /dev/null +++ b/2015/06-devnation-golang-good-bad-ugly/cats20.gif @@ -0,0 +1 @@ +../02-devconf.cz/cats20.gif \ No newline at end of file diff --git a/2015/06-devnation-golang-good-bad-ugly/good0.go b/2015/06-devnation-golang-good-bad-ugly/good0.go deleted file mode 100644 index 3a3b880..0000000 --- a/2015/06-devnation-golang-good-bad-ugly/good0.go +++ /dev/null @@ -1,48 +0,0 @@ -// +build ignore - -package main - -import ( - "compress/gzip" - "encoding/json" - "flag" - "io/ioutil" - "log" - "os" -) - -func main() { - for _, arg := range flag.Args() { - func() { - // START1 OMIT - fh, err := os.Open(arg) - if err != nil { - log.Fatal(err) - } - defer fh.Close() - - gz, err := gzip.NewReader(fh) - if err != nil { - log.Fatal(err) - } - defer gz.Close() - - buf, err := ioutil.ReadAll(gz) - if err != nil { - log.Fatal(err) - } - - var mine MyStruct - err = json.Unmarshal(&mine) - if err != nil { - log.Fatal(err) - } - // STOP1 OMIT - - }() - } - -} - -type MyStruct struct { -} diff --git a/2015/06-devnation-golang-good-bad-ugly/good0.go b/2015/06-devnation-golang-good-bad-ugly/good0.go new file mode 120000 index 0000000..e8662f7 --- /dev/null +++ b/2015/06-devnation-golang-good-bad-ugly/good0.go @@ -0,0 +1 @@ +../02-devconf.cz/good0.go \ No newline at end of file diff --git a/2015/06-devnation-golang-good-bad-ugly/good1.go b/2015/06-devnation-golang-good-bad-ugly/good1.go deleted file mode 100644 index 84a3b6e..0000000 --- a/2015/06-devnation-golang-good-bad-ugly/good1.go +++ /dev/null @@ -1,20 +0,0 @@ -// +build ignore - -package main - -// START1 OMIT -// exported -type Foo struct { - Bar string // exported - baz bool // private -} - -// private -type bif struct { - Harf, Buz int64 // doesn't matter -} - -// STOP1 OMIT - -func main() { -} diff --git a/2015/06-devnation-golang-good-bad-ugly/good1.go b/2015/06-devnation-golang-good-bad-ugly/good1.go new file mode 120000 index 0000000..e963c30 --- /dev/null +++ b/2015/06-devnation-golang-good-bad-ugly/good1.go @@ -0,0 +1 @@ +../02-devconf.cz/good1.go \ No newline at end of file diff --git a/2015/06-devnation-golang-good-bad-ugly/gopher.png b/2015/06-devnation-golang-good-bad-ugly/gopher.png deleted file mode 100644 index cb5e2e1..0000000 Binary files a/2015/06-devnation-golang-good-bad-ugly/gopher.png and /dev/null differ diff --git a/2015/06-devnation-golang-good-bad-ugly/gopher.png b/2015/06-devnation-golang-good-bad-ugly/gopher.png new file mode 120000 index 0000000..0728bc3 --- /dev/null +++ b/2015/06-devnation-golang-good-bad-ugly/gopher.png @@ -0,0 +1 @@ +../02-devconf.cz/gopher.png \ No newline at end of file diff --git a/2015/06-devnation-golang-good-bad-ugly/hello.go b/2015/06-devnation-golang-good-bad-ugly/hello.go deleted file mode 100644 index 8ad6d97..0000000 --- a/2015/06-devnation-golang-good-bad-ugly/hello.go +++ /dev/null @@ -1,10 +0,0 @@ -// +build ignore - -// START1 OMIT -package main - -func main() { - println("Howdy y'all") -} - -// STOP1 OMIT diff --git a/2015/06-devnation-golang-good-bad-ugly/hello.go b/2015/06-devnation-golang-good-bad-ugly/hello.go new file mode 120000 index 0000000..536868c --- /dev/null +++ b/2015/06-devnation-golang-good-bad-ugly/hello.go @@ -0,0 +1 @@ +../02-devconf.cz/hello.go \ No newline at end of file diff --git a/2015/06-devnation-golang-good-bad-ugly/imports.go b/2015/06-devnation-golang-good-bad-ugly/imports.go deleted file mode 100644 index ba18875..0000000 --- a/2015/06-devnation-golang-good-bad-ugly/imports.go +++ /dev/null @@ -1,18 +0,0 @@ -// +build ignore - -package main - -// START1 OMIT -import ( - "fmt" - "os" - - "github.com/foo/bar" -) - -// STOP1 OMIT - -func main() { - fmt.Println(bar.Baz()) - _ = os.FileInfo -} diff --git a/2015/06-devnation-golang-good-bad-ugly/imports.go b/2015/06-devnation-golang-good-bad-ugly/imports.go new file mode 120000 index 0000000..d686746 --- /dev/null +++ b/2015/06-devnation-golang-good-bad-ugly/imports.go @@ -0,0 +1 @@ +../02-devconf.cz/imports.go \ No newline at end of file diff --git a/2015/06-devnation-golang-good-bad-ugly/kanye_imma_bookmarklet.png b/2015/06-devnation-golang-good-bad-ugly/kanye_imma_bookmarklet.png deleted file mode 100644 index e896826..0000000 Binary files a/2015/06-devnation-golang-good-bad-ugly/kanye_imma_bookmarklet.png and /dev/null differ diff --git a/2015/06-devnation-golang-good-bad-ugly/kanye_imma_bookmarklet.png b/2015/06-devnation-golang-good-bad-ugly/kanye_imma_bookmarklet.png new file mode 120000 index 0000000..792311a --- /dev/null +++ b/2015/06-devnation-golang-good-bad-ugly/kanye_imma_bookmarklet.png @@ -0,0 +1 @@ +../02-devconf.cz/kanye_imma_bookmarklet.png \ No newline at end of file diff --git a/2015/06-devnation-golang-good-bad-ugly/pingpong.go b/2015/06-devnation-golang-good-bad-ugly/pingpong.go deleted file mode 100644 index 159d2c5..0000000 --- a/2015/06-devnation-golang-good-bad-ugly/pingpong.go +++ /dev/null @@ -1,33 +0,0 @@ -// +build OMIT - -package main - -import ( - "fmt" - "time" -) - -// STARTMAIN1 OMIT -type Ball struct{ hits int } - -func main() { - table := make(chan *Ball) - go player("ping", table) - go player("pong", table) - - table <- new(Ball) // game on; toss the ball - time.Sleep(1 * time.Second) - <-table // game over; grab the ball -} - -func player(name string, table chan *Ball) { - for { - ball := <-table - ball.hits++ - fmt.Println(name, ball.hits) - time.Sleep(100 * time.Millisecond) - table <- ball - } -} - -// STOPMAIN1 OMIT diff --git a/2015/06-devnation-golang-good-bad-ugly/pingpong.go b/2015/06-devnation-golang-good-bad-ugly/pingpong.go new file mode 120000 index 0000000..bb51bb8 --- /dev/null +++ b/2015/06-devnation-golang-good-bad-ugly/pingpong.go @@ -0,0 +1 @@ +../02-devconf.cz/pingpong.go \ No newline at end of file diff --git a/2015/06-devnation-golang-good-bad-ugly/primitive1.go b/2015/06-devnation-golang-good-bad-ugly/primitive1.go deleted file mode 100644 index d9e1961..0000000 --- a/2015/06-devnation-golang-good-bad-ugly/primitive1.go +++ /dev/null @@ -1,25 +0,0 @@ -// +build ignore - -package main - -import "fmt" - -func main() { - // START1 OMIT - names := []string{ - "Michael", - "Jan", - "Sean", - "Silvia", - } - for i, name := range names { - fmt.Printf("%q is the %d name\n", name, i) - } - for i := range names { - fmt.Printf("%q is the %d name\n", names[i], i) - } - for _, name := range names { - fmt.Printf("%q is the ... name\n", name) - } - // STOP1 OMIT -} diff --git a/2015/06-devnation-golang-good-bad-ugly/primitive1.go b/2015/06-devnation-golang-good-bad-ugly/primitive1.go new file mode 120000 index 0000000..2a032e3 --- /dev/null +++ b/2015/06-devnation-golang-good-bad-ugly/primitive1.go @@ -0,0 +1 @@ +../02-devconf.cz/primitive1.go \ No newline at end of file diff --git a/2015/06-devnation-golang-good-bad-ugly/primitive2.go b/2015/06-devnation-golang-good-bad-ugly/primitive2.go deleted file mode 100644 index 9d54624..0000000 --- a/2015/06-devnation-golang-good-bad-ugly/primitive2.go +++ /dev/null @@ -1,56 +0,0 @@ -// +build ignore - -package main - -import "fmt" - -func main() { - // START1 OMIT - infos := map[string]Info{ - "Michael": Info{ - City: "Happyville", - Status: Open, - }, - "Jan": Info{ - City: "Confusville", - Status: Closed, - }, - "Sean": Info{ - City: "Septober", - Status: Complicated, - }, - "Silvia": Info{ - City: "Curiousville", - Status: Curios, - }, - } - for name, info := range infos { - fmt.Printf("%q is %s in %q\n", name, info.Status, info.City) - } - // STOP1 OMIT -} - -type Info struct { - City string - Status Status -} -type Status int - -var ( - Open = Status(0) - Closed = Status(1) - Complicated = Status(2) - Curios = Status(3) -) - -func (s Status) String() string { - switch s { - case Open: - return "open" - case Closed: - return "closed" - case Complicated: - return "complicated" - } - return "hurr" -} diff --git a/2015/06-devnation-golang-good-bad-ugly/primitive2.go b/2015/06-devnation-golang-good-bad-ugly/primitive2.go new file mode 120000 index 0000000..bee2f3c --- /dev/null +++ b/2015/06-devnation-golang-good-bad-ugly/primitive2.go @@ -0,0 +1 @@ +../02-devconf.cz/primitive2.go \ No newline at end of file diff --git a/2015/06-devnation-golang-good-bad-ugly/primitive3.go b/2015/06-devnation-golang-good-bad-ugly/primitive3.go deleted file mode 100644 index c3329d5..0000000 --- a/2015/06-devnation-golang-good-bad-ugly/primitive3.go +++ /dev/null @@ -1,37 +0,0 @@ -// +build ignore - -package main - -import "fmt" - -func main() { - // START1 OMIT - fmt.Println("I've got:") - for card := range ReadEmAndWeep() { - fmt.Printf(" %s of %s\n", card.Value, card.Suite) - } - // STOP1 OMIT -} - -type Card struct { - Suite, Value string -} - -// START2 OMIT -func ReadEmAndWeep() <-chan Card { - c := make(chan Card) - go func() { - for _, card := range []Card{ - Card{"Ace", "Jack"}, - Card{"Ace", "Queen"}, - Card{"Ace", "King"}, - Card{"Ace", "Ace"}, - } { - c <- card - } - close(c) - }() - return c -} - -// STOP2 OMIT diff --git a/2015/06-devnation-golang-good-bad-ugly/primitive3.go b/2015/06-devnation-golang-good-bad-ugly/primitive3.go new file mode 120000 index 0000000..a26179a --- /dev/null +++ b/2015/06-devnation-golang-good-bad-ugly/primitive3.go @@ -0,0 +1 @@ +../02-devconf.cz/primitive3.go \ No newline at end of file diff --git a/2015/06-devnation-golang-good-bad-ugly/rainbow.jpg b/2015/06-devnation-golang-good-bad-ugly/rainbow.jpg deleted file mode 100644 index eb3c98e..0000000 Binary files a/2015/06-devnation-golang-good-bad-ugly/rainbow.jpg and /dev/null differ diff --git a/2015/06-devnation-golang-good-bad-ugly/rainbow.jpg b/2015/06-devnation-golang-good-bad-ugly/rainbow.jpg new file mode 120000 index 0000000..f34e151 --- /dev/null +++ b/2015/06-devnation-golang-good-bad-ugly/rainbow.jpg @@ -0,0 +1 @@ +../02-devconf.cz/rainbow.jpg \ No newline at end of file diff --git a/2015/06-devnation-golang-good-bad-ugly/revenge-of-the-nerds-o.gif b/2015/06-devnation-golang-good-bad-ugly/revenge-of-the-nerds-o.gif deleted file mode 100644 index fce49b6..0000000 Binary files a/2015/06-devnation-golang-good-bad-ugly/revenge-of-the-nerds-o.gif and /dev/null differ diff --git a/2015/06-devnation-golang-good-bad-ugly/revenge-of-the-nerds-o.gif b/2015/06-devnation-golang-good-bad-ugly/revenge-of-the-nerds-o.gif new file mode 120000 index 0000000..b4006c7 --- /dev/null +++ b/2015/06-devnation-golang-good-bad-ugly/revenge-of-the-nerds-o.gif @@ -0,0 +1 @@ +../02-devconf.cz/revenge-of-the-nerds-o.gif \ No newline at end of file diff --git a/2015/06-devnation-golang-good-bad-ugly/tags.go b/2015/06-devnation-golang-good-bad-ugly/tags.go deleted file mode 100644 index 6e89e71..0000000 --- a/2015/06-devnation-golang-good-bad-ugly/tags.go +++ /dev/null @@ -1,8 +0,0 @@ -// START1 OMIT -// +build !windows linux,cgo -// STOP1 OMIT - -package main - -func main() { -} diff --git a/2015/06-devnation-golang-good-bad-ugly/tags.go b/2015/06-devnation-golang-good-bad-ugly/tags.go new file mode 120000 index 0000000..51902b7 --- /dev/null +++ b/2015/06-devnation-golang-good-bad-ugly/tags.go @@ -0,0 +1 @@ +../02-devconf.cz/tags.go \ No newline at end of file diff --git a/2015/06-devnation-golang-good-bad-ugly/ugly0.go b/2015/06-devnation-golang-good-bad-ugly/ugly0.go deleted file mode 100644 index 715c384..0000000 --- a/2015/06-devnation-golang-good-bad-ugly/ugly0.go +++ /dev/null @@ -1,16 +0,0 @@ -// +build ignore - -package main - -func main() { - // START1 OMIT - c := make(chan int) - go func() { - for i := 0; i < 10; i++ { - c <- i - } - close(c) - }() - println(<-c) - // STOP1 OMIT -} diff --git a/2015/06-devnation-golang-good-bad-ugly/ugly0.go b/2015/06-devnation-golang-good-bad-ugly/ugly0.go new file mode 120000 index 0000000..0568649 --- /dev/null +++ b/2015/06-devnation-golang-good-bad-ugly/ugly0.go @@ -0,0 +1 @@ +../02-devconf.cz/ugly0.go \ No newline at end of file diff --git a/2015/06-devnation-golang-good-bad-ugly/ugly1.go b/2015/06-devnation-golang-good-bad-ugly/ugly1.go deleted file mode 100644 index 3d72e71..0000000 --- a/2015/06-devnation-golang-good-bad-ugly/ugly1.go +++ /dev/null @@ -1,22 +0,0 @@ -// +build ignore - -package main - -// START1 OMIT -const ( - DeviceCreate TaskType = iota - DeviceReload - DeviceRemove - DeviceRemoveAll - DeviceSuspend - DeviceResume - DeviceInfo - DeviceDeps -) - -// STOP1 OMIT - -type TaskType int - -func main() { -} diff --git a/2015/06-devnation-golang-good-bad-ugly/ugly1.go b/2015/06-devnation-golang-good-bad-ugly/ugly1.go new file mode 120000 index 0000000..93cb1a3 --- /dev/null +++ b/2015/06-devnation-golang-good-bad-ugly/ugly1.go @@ -0,0 +1 @@ +../02-devconf.cz/ugly1.go \ No newline at end of file diff --git a/2016/12-intro-to-golang/README.md b/2016/12-intro-to-golang/README.md deleted file mode 100644 index 719f863..0000000 --- a/2016/12-intro-to-golang/README.md +++ /dev/null @@ -1,6 +0,0 @@ -Usage -==== - - go get golang.org/x/tools/cmd/present - present . - diff --git a/2016/12-intro-to-golang/README.md b/2016/12-intro-to-golang/README.md new file mode 120000 index 0000000..8efbdd4 --- /dev/null +++ b/2016/12-intro-to-golang/README.md @@ -0,0 +1 @@ +../../2015/02-devconf.cz/README.md \ No newline at end of file diff --git a/2016/12-intro-to-golang/cats20.gif b/2016/12-intro-to-golang/cats20.gif deleted file mode 100644 index b6c353a..0000000 Binary files a/2016/12-intro-to-golang/cats20.gif and /dev/null differ diff --git a/2016/12-intro-to-golang/cats20.gif b/2016/12-intro-to-golang/cats20.gif new file mode 120000 index 0000000..5c149ff --- /dev/null +++ b/2016/12-intro-to-golang/cats20.gif @@ -0,0 +1 @@ +../../2015/02-devconf.cz/cats20.gif \ No newline at end of file diff --git a/2016/12-intro-to-golang/good0.go b/2016/12-intro-to-golang/good0.go deleted file mode 100644 index 3a3b880..0000000 --- a/2016/12-intro-to-golang/good0.go +++ /dev/null @@ -1,48 +0,0 @@ -// +build ignore - -package main - -import ( - "compress/gzip" - "encoding/json" - "flag" - "io/ioutil" - "log" - "os" -) - -func main() { - for _, arg := range flag.Args() { - func() { - // START1 OMIT - fh, err := os.Open(arg) - if err != nil { - log.Fatal(err) - } - defer fh.Close() - - gz, err := gzip.NewReader(fh) - if err != nil { - log.Fatal(err) - } - defer gz.Close() - - buf, err := ioutil.ReadAll(gz) - if err != nil { - log.Fatal(err) - } - - var mine MyStruct - err = json.Unmarshal(&mine) - if err != nil { - log.Fatal(err) - } - // STOP1 OMIT - - }() - } - -} - -type MyStruct struct { -} diff --git a/2016/12-intro-to-golang/good0.go b/2016/12-intro-to-golang/good0.go new file mode 120000 index 0000000..339ccf7 --- /dev/null +++ b/2016/12-intro-to-golang/good0.go @@ -0,0 +1 @@ +../../2015/02-devconf.cz/good0.go \ No newline at end of file diff --git a/2016/12-intro-to-golang/good1.go b/2016/12-intro-to-golang/good1.go deleted file mode 100644 index 84a3b6e..0000000 --- a/2016/12-intro-to-golang/good1.go +++ /dev/null @@ -1,20 +0,0 @@ -// +build ignore - -package main - -// START1 OMIT -// exported -type Foo struct { - Bar string // exported - baz bool // private -} - -// private -type bif struct { - Harf, Buz int64 // doesn't matter -} - -// STOP1 OMIT - -func main() { -} diff --git a/2016/12-intro-to-golang/good1.go b/2016/12-intro-to-golang/good1.go new file mode 120000 index 0000000..0aa2737 --- /dev/null +++ b/2016/12-intro-to-golang/good1.go @@ -0,0 +1 @@ +../../2015/02-devconf.cz/good1.go \ No newline at end of file diff --git a/2016/12-intro-to-golang/gopher.png b/2016/12-intro-to-golang/gopher.png deleted file mode 100644 index cb5e2e1..0000000 Binary files a/2016/12-intro-to-golang/gopher.png and /dev/null differ diff --git a/2016/12-intro-to-golang/gopher.png b/2016/12-intro-to-golang/gopher.png new file mode 120000 index 0000000..a6e9a44 --- /dev/null +++ b/2016/12-intro-to-golang/gopher.png @@ -0,0 +1 @@ +../../2015/02-devconf.cz/gopher.png \ No newline at end of file diff --git a/2016/12-intro-to-golang/hello.go b/2016/12-intro-to-golang/hello.go deleted file mode 100644 index 8ad6d97..0000000 --- a/2016/12-intro-to-golang/hello.go +++ /dev/null @@ -1,10 +0,0 @@ -// +build ignore - -// START1 OMIT -package main - -func main() { - println("Howdy y'all") -} - -// STOP1 OMIT diff --git a/2016/12-intro-to-golang/hello.go b/2016/12-intro-to-golang/hello.go new file mode 120000 index 0000000..0876afe --- /dev/null +++ b/2016/12-intro-to-golang/hello.go @@ -0,0 +1 @@ +../../2015/02-devconf.cz/hello.go \ No newline at end of file diff --git a/2016/12-intro-to-golang/imports.go b/2016/12-intro-to-golang/imports.go deleted file mode 100644 index ba18875..0000000 --- a/2016/12-intro-to-golang/imports.go +++ /dev/null @@ -1,18 +0,0 @@ -// +build ignore - -package main - -// START1 OMIT -import ( - "fmt" - "os" - - "github.com/foo/bar" -) - -// STOP1 OMIT - -func main() { - fmt.Println(bar.Baz()) - _ = os.FileInfo -} diff --git a/2016/12-intro-to-golang/imports.go b/2016/12-intro-to-golang/imports.go new file mode 120000 index 0000000..e0bffa5 --- /dev/null +++ b/2016/12-intro-to-golang/imports.go @@ -0,0 +1 @@ +../../2015/02-devconf.cz/imports.go \ No newline at end of file diff --git a/2016/12-intro-to-golang/kanye_imma_bookmarklet.png b/2016/12-intro-to-golang/kanye_imma_bookmarklet.png deleted file mode 100644 index e896826..0000000 Binary files a/2016/12-intro-to-golang/kanye_imma_bookmarklet.png and /dev/null differ diff --git a/2016/12-intro-to-golang/kanye_imma_bookmarklet.png b/2016/12-intro-to-golang/kanye_imma_bookmarklet.png new file mode 120000 index 0000000..8494bc6 --- /dev/null +++ b/2016/12-intro-to-golang/kanye_imma_bookmarklet.png @@ -0,0 +1 @@ +../../2015/02-devconf.cz/kanye_imma_bookmarklet.png \ No newline at end of file diff --git a/2016/12-intro-to-golang/pingpong.go b/2016/12-intro-to-golang/pingpong.go deleted file mode 100644 index 159d2c5..0000000 --- a/2016/12-intro-to-golang/pingpong.go +++ /dev/null @@ -1,33 +0,0 @@ -// +build OMIT - -package main - -import ( - "fmt" - "time" -) - -// STARTMAIN1 OMIT -type Ball struct{ hits int } - -func main() { - table := make(chan *Ball) - go player("ping", table) - go player("pong", table) - - table <- new(Ball) // game on; toss the ball - time.Sleep(1 * time.Second) - <-table // game over; grab the ball -} - -func player(name string, table chan *Ball) { - for { - ball := <-table - ball.hits++ - fmt.Println(name, ball.hits) - time.Sleep(100 * time.Millisecond) - table <- ball - } -} - -// STOPMAIN1 OMIT diff --git a/2016/12-intro-to-golang/pingpong.go b/2016/12-intro-to-golang/pingpong.go new file mode 120000 index 0000000..ea177cb --- /dev/null +++ b/2016/12-intro-to-golang/pingpong.go @@ -0,0 +1 @@ +../../2015/02-devconf.cz/pingpong.go \ No newline at end of file diff --git a/2016/12-intro-to-golang/primitive1.go b/2016/12-intro-to-golang/primitive1.go deleted file mode 100644 index d9e1961..0000000 --- a/2016/12-intro-to-golang/primitive1.go +++ /dev/null @@ -1,25 +0,0 @@ -// +build ignore - -package main - -import "fmt" - -func main() { - // START1 OMIT - names := []string{ - "Michael", - "Jan", - "Sean", - "Silvia", - } - for i, name := range names { - fmt.Printf("%q is the %d name\n", name, i) - } - for i := range names { - fmt.Printf("%q is the %d name\n", names[i], i) - } - for _, name := range names { - fmt.Printf("%q is the ... name\n", name) - } - // STOP1 OMIT -} diff --git a/2016/12-intro-to-golang/primitive1.go b/2016/12-intro-to-golang/primitive1.go new file mode 120000 index 0000000..6276d9f --- /dev/null +++ b/2016/12-intro-to-golang/primitive1.go @@ -0,0 +1 @@ +../../2015/02-devconf.cz/primitive1.go \ No newline at end of file diff --git a/2016/12-intro-to-golang/primitive2.go b/2016/12-intro-to-golang/primitive2.go deleted file mode 100644 index 9d54624..0000000 --- a/2016/12-intro-to-golang/primitive2.go +++ /dev/null @@ -1,56 +0,0 @@ -// +build ignore - -package main - -import "fmt" - -func main() { - // START1 OMIT - infos := map[string]Info{ - "Michael": Info{ - City: "Happyville", - Status: Open, - }, - "Jan": Info{ - City: "Confusville", - Status: Closed, - }, - "Sean": Info{ - City: "Septober", - Status: Complicated, - }, - "Silvia": Info{ - City: "Curiousville", - Status: Curios, - }, - } - for name, info := range infos { - fmt.Printf("%q is %s in %q\n", name, info.Status, info.City) - } - // STOP1 OMIT -} - -type Info struct { - City string - Status Status -} -type Status int - -var ( - Open = Status(0) - Closed = Status(1) - Complicated = Status(2) - Curios = Status(3) -) - -func (s Status) String() string { - switch s { - case Open: - return "open" - case Closed: - return "closed" - case Complicated: - return "complicated" - } - return "hurr" -} diff --git a/2016/12-intro-to-golang/primitive2.go b/2016/12-intro-to-golang/primitive2.go new file mode 120000 index 0000000..9a8f0dd --- /dev/null +++ b/2016/12-intro-to-golang/primitive2.go @@ -0,0 +1 @@ +../../2015/02-devconf.cz/primitive2.go \ No newline at end of file diff --git a/2016/12-intro-to-golang/primitive3.go b/2016/12-intro-to-golang/primitive3.go deleted file mode 100644 index c3329d5..0000000 --- a/2016/12-intro-to-golang/primitive3.go +++ /dev/null @@ -1,37 +0,0 @@ -// +build ignore - -package main - -import "fmt" - -func main() { - // START1 OMIT - fmt.Println("I've got:") - for card := range ReadEmAndWeep() { - fmt.Printf(" %s of %s\n", card.Value, card.Suite) - } - // STOP1 OMIT -} - -type Card struct { - Suite, Value string -} - -// START2 OMIT -func ReadEmAndWeep() <-chan Card { - c := make(chan Card) - go func() { - for _, card := range []Card{ - Card{"Ace", "Jack"}, - Card{"Ace", "Queen"}, - Card{"Ace", "King"}, - Card{"Ace", "Ace"}, - } { - c <- card - } - close(c) - }() - return c -} - -// STOP2 OMIT diff --git a/2016/12-intro-to-golang/primitive3.go b/2016/12-intro-to-golang/primitive3.go new file mode 120000 index 0000000..a799f53 --- /dev/null +++ b/2016/12-intro-to-golang/primitive3.go @@ -0,0 +1 @@ +../../2015/02-devconf.cz/primitive3.go \ No newline at end of file diff --git a/2016/12-intro-to-golang/rainbow.jpg b/2016/12-intro-to-golang/rainbow.jpg deleted file mode 100644 index eb3c98e..0000000 Binary files a/2016/12-intro-to-golang/rainbow.jpg and /dev/null differ diff --git a/2016/12-intro-to-golang/rainbow.jpg b/2016/12-intro-to-golang/rainbow.jpg new file mode 120000 index 0000000..066d78c --- /dev/null +++ b/2016/12-intro-to-golang/rainbow.jpg @@ -0,0 +1 @@ +../../2015/02-devconf.cz/rainbow.jpg \ No newline at end of file diff --git a/2016/12-intro-to-golang/revenge-of-the-nerds-o.gif b/2016/12-intro-to-golang/revenge-of-the-nerds-o.gif deleted file mode 100644 index fce49b6..0000000 Binary files a/2016/12-intro-to-golang/revenge-of-the-nerds-o.gif and /dev/null differ diff --git a/2016/12-intro-to-golang/revenge-of-the-nerds-o.gif b/2016/12-intro-to-golang/revenge-of-the-nerds-o.gif new file mode 120000 index 0000000..60d4e61 --- /dev/null +++ b/2016/12-intro-to-golang/revenge-of-the-nerds-o.gif @@ -0,0 +1 @@ +../../2015/02-devconf.cz/revenge-of-the-nerds-o.gif \ No newline at end of file diff --git a/2016/12-intro-to-golang/tags.go b/2016/12-intro-to-golang/tags.go deleted file mode 100644 index 6e89e71..0000000 --- a/2016/12-intro-to-golang/tags.go +++ /dev/null @@ -1,8 +0,0 @@ -// START1 OMIT -// +build !windows linux,cgo -// STOP1 OMIT - -package main - -func main() { -} diff --git a/2016/12-intro-to-golang/tags.go b/2016/12-intro-to-golang/tags.go new file mode 120000 index 0000000..8503188 --- /dev/null +++ b/2016/12-intro-to-golang/tags.go @@ -0,0 +1 @@ +../../2015/02-devconf.cz/tags.go \ No newline at end of file diff --git a/2016/12-intro-to-golang/ugly0.go b/2016/12-intro-to-golang/ugly0.go deleted file mode 100644 index 715c384..0000000 --- a/2016/12-intro-to-golang/ugly0.go +++ /dev/null @@ -1,16 +0,0 @@ -// +build ignore - -package main - -func main() { - // START1 OMIT - c := make(chan int) - go func() { - for i := 0; i < 10; i++ { - c <- i - } - close(c) - }() - println(<-c) - // STOP1 OMIT -} diff --git a/2016/12-intro-to-golang/ugly0.go b/2016/12-intro-to-golang/ugly0.go new file mode 120000 index 0000000..8072272 --- /dev/null +++ b/2016/12-intro-to-golang/ugly0.go @@ -0,0 +1 @@ +../../2015/02-devconf.cz/ugly0.go \ No newline at end of file diff --git a/2016/12-intro-to-golang/ugly1.go b/2016/12-intro-to-golang/ugly1.go deleted file mode 100644 index 3d72e71..0000000 --- a/2016/12-intro-to-golang/ugly1.go +++ /dev/null @@ -1,22 +0,0 @@ -// +build ignore - -package main - -// START1 OMIT -const ( - DeviceCreate TaskType = iota - DeviceReload - DeviceRemove - DeviceRemoveAll - DeviceSuspend - DeviceResume - DeviceInfo - DeviceDeps -) - -// STOP1 OMIT - -type TaskType int - -func main() { -} diff --git a/2016/12-intro-to-golang/ugly1.go b/2016/12-intro-to-golang/ugly1.go new file mode 120000 index 0000000..cadc265 --- /dev/null +++ b/2016/12-intro-to-golang/ugly1.go @@ -0,0 +1 @@ +../../2015/02-devconf.cz/ugly1.go \ No newline at end of file