|
if ok, _ := filepath.Match(patternParts[i], targetParts[i]); !ok { |
|
return false |
|
} |
|
patternMatched, err := filepath.Match(pathPattern, targetPath) |
|
if err != nil { |
|
// error looking for a match |
|
return nil, nil, err |
In theory there is some fragility in the above because filepath.Match is tied to the OS.
In general it should have negligible impact, but you might hit an edge case on Windows with \. So you might want to consider options for how you want to handle that ? Might need to check the TUF spec.
In addition err is discarded in the metadata.go version which means you have no way to distinguish between "no match" and "invalid pattern". Surely an invalid pattern should error ?
go-tuf/metadata/metadata.go
Lines 585 to 587 in 4b704cd
go-tuf/metadata/multirepo/multirepo.go
Lines 248 to 251 in 4b704cd
In theory there is some fragility in the above because
filepath.Matchis tied to the OS.In general it should have negligible impact, but you might hit an edge case on Windows with
\. So you might want to consider options for how you want to handle that ? Might need to check the TUF spec.In addition
erris discarded in themetadata.goversion which means you have no way to distinguish between "no match" and "invalid pattern". Surely an invalid pattern should error ?