chore(deps): update tools to latest versions (#2616)

* chore(deps): update tools to latest versions

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix: update to new linter rules

Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>

---------

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
Co-authored-by: spiffcs <32073428+spiffcs@users.noreply.github.com>
Co-authored-by: Christopher Phillips <christopher.phillips@anchore.com>
This commit is contained in:
anchore-actions-token-generator[bot]
2024-02-14 14:59:49 +00:00
committed by GitHub
co-authored by spiffcs Christopher Phillips
parent 3ac7369068
commit 17ef243956
17 changed files with 27 additions and 27 deletions
@@ -22,7 +22,7 @@ func AddSnippet(appConfig config.Application) *cobra.Command {
Use: "add-snippet",
Short: "capture snippets from binaries",
Args: cobra.NoArgs,
PreRunE: func(cmd *cobra.Command, args []string) error {
PreRunE: func(_ *cobra.Command, _ []string) error {
candidates, err := internal.ListAllBinaries(appConfig)
if err != nil {
return fmt.Errorf("unable to list binaries: %w", err)
@@ -44,7 +44,7 @@ func AddSnippet(appConfig config.Application) *cobra.Command {
return nil
},
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(_ *cobra.Command, _ []string) error {
name, version, _, err := inferInfoFromBinaryPath(appConfig, binaryPath)
if err != nil {
return fmt.Errorf("unable to infer name and version from binary path: %w", err)
@@ -17,7 +17,7 @@ func Download(appConfig config.Application) *cobra.Command {
cmd := &cobra.Command{
Use: "download",
Short: "download binaries [name@version ...]",
PreRunE: func(cmd *cobra.Command, args []string) error {
PreRunE: func(_ *cobra.Command, args []string) error {
if len(args) > 0 {
for _, arg := range args {
binaryFromImageCfg := appConfig.GetBinaryFromImage(arg, "")
@@ -40,7 +40,7 @@ func Download(appConfig config.Application) *cobra.Command {
return nil
},
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(_ *cobra.Command, _ []string) error {
for _, binaryFromImageCfg := range configs {
if err := internal.DownloadFromImage(appConfig.DownloadPath, binaryFromImageCfg); err != nil {
return err
@@ -19,7 +19,7 @@ func List(appConfig config.Application) *cobra.Command {
Use: "list",
Short: "list managed binaries and managed/unmanaged snippets",
Args: cobra.NoArgs,
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(_ *cobra.Command, _ []string) error {
return runList(appConfig, showPaths)
},
}
@@ -26,7 +26,7 @@ func WriteSnippet(appConfig config.Application) *cobra.Command {
Use: "write-snippet [binary]",
Short: "capture snippets from binaries",
Args: cobra.ExactArgs(1),
PreRunE: func(cmd *cobra.Command, args []string) error {
PreRunE: func(_ *cobra.Command, args []string) error {
if len(args) == 0 && (name != "" || version != "") {
return fmt.Errorf("cannot provide name or version without a binary path")
}
@@ -38,7 +38,7 @@ func WriteSnippet(appConfig config.Application) *cobra.Command {
return nil
},
RunE: func(cmd *cobra.Command, args []string) error {
RunE: func(_ *cobra.Command, _ []string) error {
platform, err := getPlatform(binaryPath)
if err != nil {
return fmt.Errorf("unable to get platform: %w", err)
@@ -169,7 +169,7 @@ func getLogicalKey(managedBinaryPath string) (*LogicalEntryKey, error) {
func allFilePaths(root string) ([]string, error) {
var paths []string
err := filepath.Walk(root, func(path string, info os.FileInfo, err error) error {
err := filepath.Walk(root, func(path string, info os.FileInfo, _ error) error {
if info != nil && !info.IsDir() && !strings.HasSuffix(path, ".fingerprint") {
paths = append(paths, path)
}
+3 -3
View File
@@ -27,7 +27,7 @@ type Cataloger struct {
func (c *Cataloger) WithParserByGlobs(parser Parser, globs ...string) *Cataloger {
c.processor = append(c.processor,
func(resolver file.Resolver, env Environment) []request {
func(resolver file.Resolver, _ Environment) []request {
var requests []request
for _, g := range globs {
log.WithFields("glob", g).Trace("searching for paths matching glob")
@@ -47,7 +47,7 @@ func (c *Cataloger) WithParserByGlobs(parser Parser, globs ...string) *Cataloger
func (c *Cataloger) WithParserByMimeTypes(parser Parser, types ...string) *Cataloger {
c.processor = append(c.processor,
func(resolver file.Resolver, env Environment) []request {
func(resolver file.Resolver, _ Environment) []request {
var requests []request
log.WithFields("mimetypes", types).Trace("searching for paths matching mimetype")
matches, err := resolver.FilesByMIMEType(types...)
@@ -64,7 +64,7 @@ func (c *Cataloger) WithParserByMimeTypes(parser Parser, types ...string) *Catal
func (c *Cataloger) WithParserByPath(parser Parser, paths ...string) *Cataloger {
c.processor = append(c.processor,
func(resolver file.Resolver, env Environment) []request {
func(resolver file.Resolver, _ Environment) []request {
var requests []request
for _, p := range paths {
log.WithFields("path", p).Trace("searching for path")
+6 -6
View File
@@ -64,16 +64,16 @@ func groupIDFromJavaManifest(manifest *pkg.JavaManifest) (groupID string) {
return groupID
}
groupIDS := cpegenerate.GetManifestFieldGroupIDs(manifest, cpegenerate.PrimaryJavaManifestGroupIDFields)
groupIDs := cpegenerate.GetManifestFieldGroupIDs(manifest, cpegenerate.PrimaryJavaManifestGroupIDFields)
// assumes that primaryJavaManifestNameFields are ordered by priority
if len(groupIDS) != 0 {
return groupIDS[0]
if len(groupIDs) != 0 {
return groupIDs[0]
}
groupIDS = cpegenerate.GetManifestFieldGroupIDs(manifest, cpegenerate.SecondaryJavaManifestGroupIDFields)
groupIDs = cpegenerate.GetManifestFieldGroupIDs(manifest, cpegenerate.SecondaryJavaManifestGroupIDFields)
if len(groupIDS) != 0 {
return groupIDS[0]
if len(groupIDs) != 0 {
return groupIDs[0]
}
return groupID