Skip to content

Commit

Permalink
Fix different capabilities on windows for github.com/google/uuid (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
breml committed Sep 19, 2023
1 parent 8ec0ec4 commit b6e986f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
4 changes: 3 additions & 1 deletion pkg/depcaps/depcaps_others_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,6 @@ import (
"github.com/breml/depcaps/pkg/depcaps"
)

func osSpecificLinterSettings(*depcaps.LinterSettings) {}
func osSpecificLinterSettings(linterSettings *depcaps.LinterSettings) *depcaps.LinterSettings {
return linterSettings
}
2 changes: 1 addition & 1 deletion pkg/depcaps/depcaps_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ func TestAll(t *testing.T) {
}
}()

osSpecificLinterSettings(tc.linterSettings)
tc.linterSettings = osSpecificLinterSettings(tc.linterSettings)

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

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

func osSpecificLinterSettings(linterSettings *depcaps.LinterSettings) {
func osSpecificLinterSettings(linterSettings *depcaps.LinterSettings) *depcaps.LinterSettings {
if linterSettings == nil {
linterSettings = &depcaps.LinterSettings{}
}
if linterSettings.GlobalAllowedCapabilities == nil {
linterSettings.GlobalAllowedCapabilities = make(map[string]bool, 1)
}
linterSettings.GlobalAllowedCapabilities["CAPABILITY_SYSTEM_CALLS"] = true

return linterSettings
}

0 comments on commit b6e986f

Please sign in to comment.