mirror of
https://gitee.com/johng/gf.git
synced 2024-12-05 05:37:55 +08:00
26 lines
430 B
Go
26 lines
430 B
Go
package main
|
|
|
|
import (
|
|
"errors"
|
|
"fmt"
|
|
|
|
"github.com/gogf/gf/errors/gerror"
|
|
)
|
|
|
|
func Error1() error {
|
|
return errors.New("test1")
|
|
}
|
|
|
|
func Error2() error {
|
|
return gerror.New("test2")
|
|
}
|
|
|
|
func main() {
|
|
err1 := Error1()
|
|
err2 := Error2()
|
|
fmt.Printf("%s, %-s, %+s\n", err1, err1, err1)
|
|
fmt.Printf("%v, %-v, %+v\n", err1, err1, err1)
|
|
fmt.Printf("%s, %-s, %+s\n", err2, err2, err2)
|
|
fmt.Printf("%v, %-v, %+v\n", err2, err2, err2)
|
|
}
|