diff --git a/extractor/filesystem/os/rpm/rpm_linux.go b/extractor/filesystem/os/rpm/rpm.go similarity index 98% rename from extractor/filesystem/os/rpm/rpm_linux.go rename to extractor/filesystem/os/rpm/rpm.go index d078a83b4..e3c1e1136 100644 --- a/extractor/filesystem/os/rpm/rpm_linux.go +++ b/extractor/filesystem/os/rpm/rpm.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build linux +//go:build !windows // Package rpm extracts packages from rpm database. package rpm @@ -113,7 +113,9 @@ func (e Extractor) Name() string { return Name } func (e Extractor) Version() int { return 0 } // Requirements of the extractor. -func (e Extractor) Requirements() *plugin.Capabilities { return &plugin.Capabilities{} } +func (e Extractor) Requirements() *plugin.Capabilities { + return &plugin.Capabilities{} +} // FileRequired returns true if the specified file matches rpm status file pattern. func (e Extractor) FileRequired(api filesystem.FileAPI) bool { diff --git a/extractor/filesystem/os/rpm/rpm_dummy.go b/extractor/filesystem/os/rpm/rpm_dummy.go index b80a05111..7ce7b194e 100644 --- a/extractor/filesystem/os/rpm/rpm_dummy.go +++ b/extractor/filesystem/os/rpm/rpm_dummy.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build !linux +//go:build windows // Package rpm extracts packages from rpm database. package rpm diff --git a/extractor/filesystem/os/rpm/rpm_test.go b/extractor/filesystem/os/rpm/rpm_test.go index 075a5ff91..2a8647c7c 100644 --- a/extractor/filesystem/os/rpm/rpm_test.go +++ b/extractor/filesystem/os/rpm/rpm_test.go @@ -21,7 +21,6 @@ import ( "path" "path/filepath" "runtime" - "slices" "sort" "strings" "testing" @@ -44,7 +43,7 @@ import ( func TestFileRequired(t *testing.T) { // supported OSes - if !slices.Contains([]string{"linux"}, runtime.GOOS) { + if runtime.GOOS == "windows" { t.Skipf("Test skipped, OS unsupported: %v", runtime.GOOS) } @@ -172,7 +171,7 @@ VARIANT="Container Image"` func TestExtract(t *testing.T) { // supported OSes - if !slices.Contains([]string{"linux"}, runtime.GOOS) { + if runtime.GOOS == "windows" { t.Skipf("Test skipped, OS unsupported: %v", runtime.GOOS) } @@ -566,7 +565,7 @@ func TestExtract(t *testing.T) { func TestExtract_VirtualFilesystem(t *testing.T) { // supported OSes - if !slices.Contains([]string{"linux"}, runtime.GOOS) { + if runtime.GOOS == "windows" { t.Skipf("Test skipped, OS unsupported: %v", runtime.GOOS) }