1 Star 1 Fork 0

fast_api/api

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
exclude.go 1.12 KB
一键复制 编辑 原始数据 按行查看 历史
t.io 提交于 2023-03-14 13:13 +08:00 . add more runtime ex
package dwarf
import (
"debug/gosym"
"strings"
)
var exclude = map[string]interface{}{
"bufio": nil,
"fmt": nil,
"strconv": nil,
"os": nil,
"net": nil,
"errors": nil,
"http": nil,
"context": nil,
"io": nil,
"sync": nil,
"testing": nil,
"reflect": nil,
"regexp": nil,
"runtime": nil,
"syscall": nil,
"sort": nil,
"math": nil,
"internal": nil,
"unicode": nil,
"text": nil,
"log": nil,
"hash": nil,
"flag": nil,
"html": nil,
"heap": nil,
"test": nil,
"go": nil,
"bytes": nil,
"time": nil,
"strings": nil,
"compress": nil,
"encoding": nil,
"debug": nil,
"path": nil,
"crypto": nil,
"embed": nil,
"database": nil,
}
func isRuntimePackage(pkg string) bool {
if strings.HasPrefix(pkg, "type..") || strings.HasPrefix(pkg, "type:") {
return true
}
sym := gosym.Sym{
Name: pkg,
}
pkg = sym.PackageName()
if index := strings.IndexAny(pkg, "/"); index > 0 {
if _, b := exclude[pkg[:index]]; b {
return true
}
} else {
if _, b := exclude[pkg]; b {
return true
}
}
return false
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/fast_api/api.git
git@gitee.com:fast_api/api.git
fast_api
api
api
v0.1.0

搜索帮助