diff --git a/README b/README index 512b495..60a112a 100644 --- a/README +++ b/README @@ -44,9 +44,14 @@ gobyexample.com signups * ruby and nodejs killer apps = topics -* gzip -* listing files * regular expressions +* time +* connection pool +* typed json parse/unparse +* web app +* gzip +* base64 encoding +* listing files * tls server * tls client * https server @@ -57,28 +62,19 @@ gobyexample.com signups * http streaming client * http proxy * templating -* web app * hipache port -* templating * ssh * dns * timers * tty * iota -* apps with multiple named binaries -* versioned transitive libraries and pegging -* creating and distributing packages, putting on github -* distributing go binary programs -* deploying to heroku -* sort-by -* errors -* compilation -* time * oauth for google domains -* connection pool -* typed json parse/unparse +* testing +* setting up go env, hello world * deploying to heroku +* distributing go binary programs +* apps with multiple named binaries * shipping a package (structure, github, docs) * blackfriday diff --git a/src/xx-dns.go b/src/xx-dns.go new file mode 100644 index 0000000..e777656 --- /dev/null +++ b/src/xx-dns.go @@ -0,0 +1,7 @@ +package main + +import ("net/dns", "fmt") + +func main() { + // https://github.com/miekg/dns/blob/master/ex/q/q.go +} \ No newline at end of file diff --git a/src/xx-errors.go b/src/xx-errors.go new file mode 100644 index 0000000..290a5e5 --- /dev/null +++ b/src/xx-errors.go @@ -0,0 +1,19 @@ +package main + +import ("fmt"; "errors") + +func myFun(arg int) (int, error) { + if arg == 42 { + return -1, errors.New("Can't work with 42") + + } + return arg + 3, nil +} + +func main() { + r, _ := myFun(7) + fmt.Println(r) + + _, e := myFun(42) + fmt.Println(e) +}