add error code feature for package gerror

This commit is contained in:
John Guo
2020-12-10 23:33:24 +08:00
parent a577605726
commit 84fef8dea3
11 changed files with 188 additions and 50 deletions

View File

@ -1,4 +1,4 @@
// Copyright 2019 gf Author(https://github.com/gogf/gf). All Rights Reserved.
// Copyright GoFrame Author(https://github.com/gogf/gf). All Rights Reserved.
//
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file,
@ -12,13 +12,13 @@ import "runtime"
type stack []uintptr
const (
gMAX_STACK_DEPTH = 32
maxStackDepth = 32
)
// callers returns the stack callers.
func callers(skip ...int) stack {
var (
pcs [gMAX_STACK_DEPTH]uintptr
pcs [maxStackDepth]uintptr
n = 3
)
if len(skip) > 0 {