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