Skip to content

Commit

Permalink
Fix different capabilities on windows for github.com/google/uuid
Browse files Browse the repository at this point in the history
  • Loading branch information
breml committed Sep 19, 2023
1 parent 59dfcf2 commit ce231f1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 2 deletions.
3 changes: 1 addition & 2 deletions pkg/depcaps/depcaps.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,7 @@ func (d *depcaps) run(pass *analysis.Pass) (interface{}, error) {

packageNames := []string{pass.Pkg.Path()}

var classifier analyzer.Classifier
classifier = analyzer.GetClassifier(true)
var classifier analyzer.Classifier = analyzer.GetClassifier(true)

// TODO: can this be optimized, since we get the packages already from pass?
pkgs := analyzer.LoadPackages(packageNames,
Expand Down
7 changes: 7 additions & 0 deletions pkg/depcaps/depcaps_linux_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package depcaps_test

import (
"github.com/breml/depcaps/pkg/depcaps"
)

func osSpecificLinterSettings(linterSettings *depcaps.LinterSettings) {}
2 changes: 2 additions & 0 deletions pkg/depcaps/depcaps_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ func TestAll(t *testing.T) {
}
}()

osSpecificLinterSettings(tc.linterSettings)

Check failure on line 115 in pkg/depcaps/depcaps_test.go

View workflow job for this annotation

GitHub Actions / Go (1.21, macos-latest)

undefined: osSpecificLinterSettings

Check failure on line 115 in pkg/depcaps/depcaps_test.go

View workflow job for this annotation

GitHub Actions / Go (1.x, macos-latest)

undefined: osSpecificLinterSettings

analysistest.Run(t, testCaseDir, tc.analyzerFunc(tc.linterSettings), ".")
})
}
Expand Down
7 changes: 7 additions & 0 deletions pkg/depcaps/depcaps_windows_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package depcaps_test

import "github.com/breml/depcaps/pkg/depcaps"

func osSpecificLinterSettings(linterSettings *depcaps.LinterSettings) {
linterSettings.GlobalAllowedCapabilities["CAPABILITY_SYSTEM_CALLS"] = true
}

0 comments on commit ce231f1

Please sign in to comment.