mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 01:55:35 +08:00
update book code
This commit is contained in:
14
eBook/examples/chapter_13/errors.go
Normal file
14
eBook/examples/chapter_13/errors.go
Normal file
@@ -0,0 +1,14 @@
|
||||
// errors.go
|
||||
package main
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
var errNotFound error = errors.New("Not found error")
|
||||
|
||||
func main() {
|
||||
fmt.Printf("error: %v", errNotFound)
|
||||
}
|
||||
// error: Not found error
|
Reference in New Issue
Block a user