mirror of
https://github.com/anchore/syft
synced 2024-11-10 14:24:12 +00:00
swap format readseekers for readers (#2581)
Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
parent
6107e5e2ad
commit
5a9b664fef
2 changed files with 6 additions and 10 deletions
|
@ -28,11 +28,11 @@ func Decoders() []sbom.FormatDecoder {
|
|||
}
|
||||
|
||||
// Identify takes a set of bytes and attempts to identify the format of the SBOM.
|
||||
func Identify(reader io.ReadSeeker) (sbom.FormatID, string) {
|
||||
func Identify(reader io.Reader) (sbom.FormatID, string) {
|
||||
return staticDecoders.Identify(reader)
|
||||
}
|
||||
|
||||
// Decode takes a set of bytes and attempts to decode it into an SBOM.
|
||||
func Decode(reader io.ReadSeeker) (*sbom.SBOM, sbom.FormatID, string, error) {
|
||||
func Decode(reader io.Reader) (*sbom.SBOM, sbom.FormatID, string, error) {
|
||||
return staticDecoders.Decode(reader)
|
||||
}
|
||||
|
|
|
@ -276,18 +276,14 @@ func TestSelectName(t *testing.T) {
|
|||
expected: "atlassian-gadgets-api",
|
||||
},
|
||||
{
|
||||
desc: "Filename has period that is not groupid + artifact id",
|
||||
manifest: pkg.JavaManifest{
|
||||
Main: map[string]string{},
|
||||
},
|
||||
desc: "Filename has period that is not groupid + artifact id",
|
||||
manifest: pkg.JavaManifest{},
|
||||
archive: newJavaArchiveFilename("/something/http4s-crypto_2.12-0.1.0.jar"),
|
||||
expected: "http4s-crypto_2.12",
|
||||
},
|
||||
{
|
||||
desc: "Filename has period that is not groupid + artifact id, kafka",
|
||||
manifest: pkg.JavaManifest{
|
||||
Main: map[string]string{},
|
||||
},
|
||||
desc: "Filename has period that is not groupid + artifact id, kafka",
|
||||
manifest: pkg.JavaManifest{},
|
||||
archive: newJavaArchiveFilename("/something//kafka_2.13-3.2.2.jar"),
|
||||
expected: "kafka_2.13", // see https://mvnrepository.com/artifact/org.apache.kafka/kafka_2.13/3.2.2
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue