mirror of
https://gitee.com/johng/gf
synced 2026-07-09 06:50:30 +08:00
improve adapter definition for package gcache
This commit is contained in:
@ -9,6 +9,7 @@ package gdebug
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
)
|
||||
@ -68,8 +69,13 @@ func StackWithFilters(filters []string, skip ...int) string {
|
||||
file[0:len(goRootForFilter)] == goRootForFilter {
|
||||
continue
|
||||
}
|
||||
// Custom filtering.
|
||||
filtered = false
|
||||
for _, filter := range filters {
|
||||
// Ignore test files.
|
||||
if strings.HasSuffix(filepath.Base(file), "_test.go") {
|
||||
break
|
||||
}
|
||||
if filter != "" && strings.Contains(file, filter) {
|
||||
filtered = true
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user