forked from mcoops/deplist
-
Notifications
You must be signed in to change notification settings - Fork 5
/
dependencies.go
20 lines (16 loc) · 739 Bytes
/
dependencies.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package deplist
// Bitmask type allows easy tagging of what langs there are
type Bitmask uint32
// Dependency per dependency info
type Dependency struct {
DepType Bitmask // golang, nodejs, python etc
Path string // the module path, github.com/teris-io/shortid
Version string // v0.0.0-20171029131806-771a37caa5cf
Files []string // if available, list of all files for a package
// /usr/lib/go-1.13/src/regexp/syntax/compile.go
// /usr/lib/go-1.13/src/regexp/syntax/doc.go
}
// DepFoundAddFlag add a lang type to the bitmask
func (f *Bitmask) DepFoundAddFlag(flag Bitmask) { *f |= flag }
// DepFoundHasFlag deteremine if bitmask has a lang type
func (f Bitmask) DepFoundHasFlag(flag Bitmask) bool { return f&flag != 0 }