You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm new to Golang so I may have missed or messed up but I'm recieving a import cycle not allowed error when trying to use this packge with the decode example
Error I'm receiving:
package command-line-arguments
imports github.com/CycloneDX/cyclonedx-go
imports github.com/CycloneDX/cyclonedx-go: import cycle not allowed
// main.gopackage main
import (
"fmt""net/http"
cdx "github.com/CycloneDX/cyclonedx-go"
)
funcmain() {
// Acquire a BOM (e.g. by downloading it)res, err:=http.Get("https://github.com/DependencyTrack/dependency-track/releases/download/4.1.0/bom.json")
iferr!=nil {
panic(err)
}
deferres.Body.Close()
// Decode the BOMbom:=new(cdx.BOM)
decoder:=cdx.NewBOMDecoder(res.Body, cdx.BOMFileFormatJSON)
iferr=decoder.Decode(bom); err!=nil {
panic(err)
}
fmt.Printf("Successfully decoded BOM of %s\n", bom.Metadata.Component.PackageURL)
fmt.Printf("- Generated: %s with %s\n", bom.Metadata.Timestamp, (*bom.Metadata.Tools.Tools)[0].Name)
fmt.Printf("- Components: %d\n", len(*bom.Components))
}
I'm new to Golang so I may have missed or messed up but I'm recieving a import cycle not allowed error when trying to use this packge with the decode example
Error I'm receiving:
The text was updated successfully, but these errors were encountered: