打印错误对象中的堆栈信息

    执行后,终端输出:

    1. err: json.Marshal failed: json: unsupported type: func()

    执行后,终端输出:

    1. err: json.Marshal failed: json: unsupported type: func()
    2. /Users/john/Workspace/Go/GOPATH/src/github.com/gogf/gf/internal/json/json.go:30
    3. 2). github.com/gogf/gf/v2/encoding/gjson.Encode
    4. 3). main.main
    5. 2. json: unsupported type: func()

    正确的错误对象Wrap方式

    执行后,终端输出,可以看到,打印的错误信息出现了重复:

      执行后,终端输出:

      1. err: error occurred: json.Marshal failed: json: unsupported type: func()