mirror of
https://github.com/securego/gosec.git
synced 2025-11-25 22:22:17 +02:00
Major rework of codebase
- Get rid of 'core' and move CLI to cmd/gas directory - Migrate (most) tests to use Ginkgo and testutils framework - GAS now expects package to reside in $GOPATH - GAS now can resolve dependencies for better type checking (if package on GOPATH) - Simplified public API
This commit is contained in:
@@ -34,9 +34,11 @@ func NewImportTracker() *ImportTracker {
|
||||
|
||||
func (t *ImportTracker) TrackPackages(pkgs ...*types.Package) {
|
||||
for _, pkg := range pkgs {
|
||||
for _, imp := range pkg.Imports() {
|
||||
t.Imported[imp.Path()] = imp.Name()
|
||||
}
|
||||
t.Imported[pkg.Path()] = pkg.Name()
|
||||
// Transient imports
|
||||
//for _, imp := range pkg.Imports() {
|
||||
// t.Imported[imp.Path()] = imp.Name()
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,8 +54,6 @@ func (t *ImportTracker) TrackImport(n ast.Node) {
|
||||
t.Aliased[path] = imported.Name.Name
|
||||
}
|
||||
}
|
||||
|
||||
// unsafe is not included in Package.Imports()
|
||||
if path == "unsafe" {
|
||||
t.Imported[path] = path
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user