mirror of
https://github.com/anchore/syft.git
synced 2026-10-31 14:36:33 +01:00
exclusions does not need to be variadic (#711)
This commit is contained in:
@@ -35,7 +35,7 @@ type Source struct {
|
||||
type sourceDetector func(string) (image.Source, string, error)
|
||||
|
||||
// New produces a Source based on userInput like dir: or image:tag
|
||||
func New(userInput string, registryOptions *image.RegistryOptions, exclusions ...string) (*Source, func(), error) {
|
||||
func New(userInput string, registryOptions *image.RegistryOptions, exclusions []string) (*Source, func(), error) {
|
||||
fs := afero.NewOsFs()
|
||||
parsedScheme, imageSource, location, err := detectScheme(fs, image.DetectSource, userInput)
|
||||
if err != nil {
|
||||
|
||||
@@ -420,7 +420,7 @@ func TestDirectoryExclusions(t *testing.T) {
|
||||
registryOpts := &image.RegistryOptions{}
|
||||
for _, test := range testCases {
|
||||
t.Run(test.desc, func(t *testing.T) {
|
||||
src, fn, err := New("dir:"+test.input, registryOpts, test.exclusions...)
|
||||
src, fn, err := New("dir:"+test.input, registryOpts, test.exclusions)
|
||||
defer fn()
|
||||
|
||||
if test.err {
|
||||
@@ -512,7 +512,7 @@ func TestImageExclusions(t *testing.T) {
|
||||
for _, test := range testCases {
|
||||
t.Run(test.desc, func(t *testing.T) {
|
||||
archiveLocation := imagetest.PrepareFixtureImage(t, "docker-archive", test.input)
|
||||
src, fn, err := New(archiveLocation, registryOpts, test.exclusions...)
|
||||
src, fn, err := New(archiveLocation, registryOpts, test.exclusions)
|
||||
defer fn()
|
||||
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user