remove variadic functionality from intRef() test helper

Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
This commit is contained in:
Alex Goodman
2021-06-02 17:13:31 -04:00
parent 2f81a2548c
commit afbd8f8ea0
3 changed files with 12 additions and 21 deletions
+3 -6
View File
@@ -91,7 +91,7 @@ func TestPackageURL(t *testing.T) {
Metadata: pkg.RpmdbMetadata{
Name: "name",
Version: "0.1.0",
Epoch: intRef(),
Epoch: nil,
Arch: "amd64",
Release: "3",
},
@@ -131,9 +131,6 @@ func TestPackageURL(t *testing.T) {
}
}
func intRef(i ...int) *int {
if len(i) == 0 {
return nil
}
return &i[0]
func intRef(i int) *int {
return &i
}
+4 -7
View File
@@ -72,7 +72,7 @@ func TestParseRpmDB(t *testing.T) {
MetadataType: pkg.RpmdbMetadataType,
Metadata: pkg.RpmdbMetadata{
Name: "dive",
Epoch: intRef(),
Epoch: nil,
Arch: "x86_64",
Release: "1",
Version: "0.9.2",
@@ -99,7 +99,7 @@ func TestParseRpmDB(t *testing.T) {
MetadataType: pkg.RpmdbMetadataType,
Metadata: pkg.RpmdbMetadata{
Name: "dive",
Epoch: intRef(),
Epoch: nil,
Arch: "x86_64",
Release: "1",
Version: "0.9.2",
@@ -204,9 +204,6 @@ func TestToElVersion(t *testing.T) {
}
}
func intRef(i ...int) *int {
if len(i) == 0 {
return nil
}
return &i[0]
func intRef(i int) *int {
return &i
}