github.com/hedzr/evendeep@v0.4.8/structiterator_packageisreserved.go (about) 1 package evendeep 2 3 func packageisreserved(packagename string) (shouldIgnored bool) { 4 onceinitignoredpackages.Do(func() { 5 _ignoredpackageprefixes = ignoredpackageprefixes{ 6 "github.com/golang", 7 "golang.org/", 8 "google.golang.org/", 9 } 10 // the following name list comes with go1.18beta1 src/. 11 // Perhaps it would need to be updated in the future. 12 _ignoredpackages = ignoredpackages{ 13 "archive": true, 14 "bufio": true, 15 "builtin": true, 16 "bytes": true, 17 "cmd": true, 18 "compress": true, 19 "container": true, 20 "context": true, 21 "crypto": true, 22 "database": true, 23 "debug": true, 24 "embed": true, 25 "encoding": true, 26 "errors": true, 27 "expvar": true, 28 "flag": true, 29 "fmt": true, 30 "go": true, 31 "hash": true, 32 "html": true, 33 "image": true, 34 "index": true, 35 "internal": true, 36 "io": true, 37 "log": true, 38 "math": true, 39 "mime": true, 40 "net": true, 41 "os": true, 42 "path": true, 43 "plugin": true, 44 "reflect": true, 45 "regexp": true, 46 "runtime": true, 47 "sort": true, 48 "strconv": true, 49 "strings": true, 50 "sync": true, 51 "syscall": true, 52 "testdata": true, 53 "testing": true, 54 "text": true, 55 "time": true, 56 "unicode": true, 57 "unsafe": true, 58 "vendor": true, 59 } 60 }) 61 62 shouldIgnored = packagename != "" && (_ignoredpackages.contains(packagename) || 63 _ignoredpackageprefixes.contains(packagename)) 64 return 65 }