errors
This commit is contained in:
parent
ebcadd96c3
commit
cdcb3e1c00
26
README
26
README
@ -44,9 +44,14 @@ gobyexample.com signups
|
|||||||
* ruby and nodejs killer apps
|
* ruby and nodejs killer apps
|
||||||
|
|
||||||
= topics
|
= topics
|
||||||
* gzip
|
|
||||||
* listing files
|
|
||||||
* regular expressions
|
* regular expressions
|
||||||
|
* time
|
||||||
|
* connection pool
|
||||||
|
* typed json parse/unparse
|
||||||
|
* web app
|
||||||
|
* gzip
|
||||||
|
* base64 encoding
|
||||||
|
* listing files
|
||||||
* tls server
|
* tls server
|
||||||
* tls client
|
* tls client
|
||||||
* https server
|
* https server
|
||||||
@ -57,28 +62,19 @@ gobyexample.com signups
|
|||||||
* http streaming client
|
* http streaming client
|
||||||
* http proxy
|
* http proxy
|
||||||
* templating
|
* templating
|
||||||
* web app
|
|
||||||
* hipache port
|
* hipache port
|
||||||
* templating
|
|
||||||
* ssh
|
* ssh
|
||||||
* dns
|
* dns
|
||||||
* timers
|
* timers
|
||||||
* tty
|
* tty
|
||||||
* iota
|
* 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
|
* oauth for google domains
|
||||||
* connection pool
|
* testing
|
||||||
* typed json parse/unparse
|
|
||||||
|
|
||||||
|
* setting up go env, hello world
|
||||||
* deploying to heroku
|
* deploying to heroku
|
||||||
|
* distributing go binary programs
|
||||||
|
* apps with multiple named binaries
|
||||||
* shipping a package (structure, github, docs)
|
* shipping a package (structure, github, docs)
|
||||||
|
|
||||||
* blackfriday
|
* blackfriday
|
||||||
|
7
src/xx-dns.go
Normal file
7
src/xx-dns.go
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import ("net/dns", "fmt")
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
// https://github.com/miekg/dns/blob/master/ex/q/q.go
|
||||||
|
}
|
19
src/xx-errors.go
Normal file
19
src/xx-errors.go
Normal file
@ -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)
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user