代码拉取完成,页面将自动刷新
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
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。