mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-21 23:00:42 -08:00
chore: enable go-critic (#5302)
* chore: enable gocritic Signed-off-by: knqyf263 <knqyf263@gmail.com> * refactor: fix lint issues Signed-off-by: knqyf263 <knqyf263@gmail.com> * test: return true for latest versions Signed-off-by: knqyf263 <knqyf263@gmail.com> * chore(lint): enforce map and slice styles Signed-off-by: knqyf263 <knqyf263@gmail.com> --------- Signed-off-by: knqyf263 <knqyf263@gmail.com>
This commit is contained in:
@@ -79,7 +79,7 @@ func (u *Updater) Update() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func Init(cacheDir string, javaDBRepository string, skip, quiet bool, registryOption ftypes.RegistryOptions) {
|
||||
func Init(cacheDir, javaDBRepository string, skip, quiet bool, registryOption ftypes.RegistryOptions) {
|
||||
updater = &Updater{
|
||||
repo: fmt.Sprintf("%s:%d", javaDBRepository, db.SchemaVersion),
|
||||
dbDir: filepath.Join(cacheDir, "java-db"),
|
||||
@@ -151,7 +151,7 @@ func (d *DB) SearchByArtifactID(artifactID string) (string, error) {
|
||||
|
||||
// Some artifacts might have the same artifactId.
|
||||
// e.g. "javax.servlet:jstl" and "jstl:jstl"
|
||||
groupIDs := map[string]int{}
|
||||
groupIDs := make(map[string]int)
|
||||
for _, index := range indexes {
|
||||
if i, ok := groupIDs[index.GroupID]; ok {
|
||||
groupIDs[index.GroupID] = i + 1
|
||||
|
||||
Reference in New Issue
Block a user