mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 16:33:21 +01: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
@ -28,11 +28,11 @@ func Decoders() []sbom.FormatDecoder {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Identify takes a set of bytes and attempts to identify the format of the SBOM.
|
// 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)
|
return staticDecoders.Identify(reader)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Decode takes a set of bytes and attempts to decode it into an SBOM.
|
// 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)
|
return staticDecoders.Decode(reader)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -276,18 +276,14 @@ func TestSelectName(t *testing.T) {
|
|||||||
expected: "atlassian-gadgets-api",
|
expected: "atlassian-gadgets-api",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
desc: "Filename has period that is not groupid + artifact id",
|
desc: "Filename has period that is not groupid + artifact id",
|
||||||
manifest: pkg.JavaManifest{
|
manifest: pkg.JavaManifest{},
|
||||||
Main: map[string]string{},
|
|
||||||
},
|
|
||||||
archive: newJavaArchiveFilename("/something/http4s-crypto_2.12-0.1.0.jar"),
|
archive: newJavaArchiveFilename("/something/http4s-crypto_2.12-0.1.0.jar"),
|
||||||
expected: "http4s-crypto_2.12",
|
expected: "http4s-crypto_2.12",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
desc: "Filename has period that is not groupid + artifact id, kafka",
|
desc: "Filename has period that is not groupid + artifact id, kafka",
|
||||||
manifest: pkg.JavaManifest{
|
manifest: pkg.JavaManifest{},
|
||||||
Main: map[string]string{},
|
|
||||||
},
|
|
||||||
archive: newJavaArchiveFilename("/something//kafka_2.13-3.2.2.jar"),
|
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
|
expected: "kafka_2.13", // see https://mvnrepository.com/artifact/org.apache.kafka/kafka_2.13/3.2.2
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user