package main
import (
"context"
"errors"
"github.com/gogf/gf/v2/errors/gerror"
"github.com/gogf/gf/v2/os/glog"
)
func MakeError() error {
return errors.New("connection closed with normal error")
}
func MakeGError() error {
return gerror.New("connection closed with gerror")
}
func TestGError(ctx context.Context) {
err1 := MakeError()
err2 := MakeGError()
glog.Error(ctx, err1)
glog.Errorf(ctx, "%+v", err2)
}
func main() {
ctx := context.TODO()
TestGError(ctx)
}