зеркало из https://github.com/golang/dep.git
Basic mapping of stdlib
Really need an automated process for redetecting and regenerating this.
This commit is contained in:
Родитель
5122082c65
Коммит
a4cd9f9147
|
@ -13,6 +13,7 @@ import (
|
|||
|
||||
var osList []string
|
||||
var archList []string
|
||||
var stdlib map[string]struct{}
|
||||
|
||||
func init() {
|
||||
// The supported systems are listed in
|
||||
|
@ -23,6 +24,11 @@ func init() {
|
|||
|
||||
archListString := "386 amd64 amd64p32 arm armbe arm64 arm64be ppc64 ppc64le mips mipsle mips64 mips64le mips64p32 mips64p32le ppc s390 s390x sparc sparc64"
|
||||
archList = strings.Split(archListString, " ")
|
||||
|
||||
stdlibPkgs := "archive archive/tar archive/zip bufio builtin bytes compress compress/bzip2 compress/flate compress/gzip compress/lzw compress/zlib container container/heap container/list container/ring crypto crypto/aes crypto/cipher crypto/des crypto/dsa crypto/ecdsa crypto/elliptic crypto/hmac crypto/md5 crypto/rand crypto/rc4 crypto/rsa crypto/sha1 crypto/sha256 crypto/sha512 crypto/subtle crypto/tls crypto/x509 crypto/x509/pkix database database/sql database/sql/driver debug debug/dwarf debug/elf debug/gosym debug/macho debug/pe debug/plan9obj encoding encoding/ascii85 encoding/asn1 encoding/base32 encoding/base64 encoding/binary encoding/csv encoding/gob encoding/hex encoding/json encoding/pem encoding/xml errors expvar flag fmt go go/ast go/build go/constant go/doc go/format go/importer go/parser go/printer go/scanner go/token go/types hash hash/adler32 hash/crc32 hash/crc64 hash/fnv html html/template image image/color image/color/palette image/draw image/gif image/jpeg image/png index index/suffixarray io io/ioutil log log/syslog math math/big math/cmplx math/rand mime mime/multipart mime/quotedprintable net net/http net/http/cgi net/http/cookiejar net/http/fcgi net/http/httptest net/http/httputil net/http/pprof net/mail net/rpc net/rpc/jsonrpc net/smtp net/textproto net/url os os/exec os/signal os/user path path/filepath reflect regexp regexp/syntax runtime runtime/cgo runtime/debug runtime/msan runtime/pprof runtime/race runtime/trace sort strconv strings sync sync/atomic syscall testing testing/iotest testing/quick text text/scanner text/tabwriter text/template text/template/parse time unicode unicode/utf16 unicode/utf8 unsafe"
|
||||
for _, pkg := range strings.Split(stdlibPkgs, " ") {
|
||||
stdlib[pkg] = struct{}{}
|
||||
}
|
||||
}
|
||||
|
||||
// ExternalReach takes a base directory (a project root), and computes the list
|
||||
|
@ -122,11 +128,12 @@ func ExternalReach(basedir, projname string, main bool) (rm map[string][]string,
|
|||
// find something in the 'in' list (which shouldn't be possible)
|
||||
//
|
||||
// This implementation is hilariously inefficient in pure computational
|
||||
// complexity terms - worst case is probably O(n³)-ish, versus O(n) for the
|
||||
// filesystem scan itself. However, the coefficient for filesystem access is
|
||||
// so much larger than for memory twiddling that it would probably take an
|
||||
// absurdly large and snaky project to ever have that worst-case polynomial
|
||||
// growth supercede (or even become comparable to) the linear side.
|
||||
// complexity terms - worst case is some flavor of polynomial, versus O(n)
|
||||
// for the filesystem scan itself. However, the coefficient for filesystem
|
||||
// access is so much larger than for memory twiddling that it would probably
|
||||
// take an absurdly large and snaky project to ever have that worst-case
|
||||
// polynomial growth supercede (or even become comparable to) the linear
|
||||
// side.
|
||||
//
|
||||
// But, if that day comes, we can improve this algorithm.
|
||||
rm = make(map[string][]string)
|
||||
|
|
Загрузка…
Ссылка в новой задаче