Error

假設某個 func 會回傳 error,可以用如下印 error
err := http.ListenAndServe("8090", nil);
if err != nil {
log.Fatal(err)
}或是
一般 log
自定義
其他可參見 panic, recover
Last updated
Was this helpful?

假設某個 func 會回傳 error,可以用如下印 error
err := http.ListenAndServe("8090", nil);
if err != nil {
log.Fatal(err)
}或是
其他可參見 panic, recover
Last updated
Was this helpful?
Was this helpful?
fmt.Printf("%s", err)log.Print("Logging to a file in Go!") import (
"errors"
)
err1 := errors.New("Some error")
fmt.Println(err1)