mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-05 20:40:16 -08:00
fix: enable usestdlibvars linter (#7770)
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
This commit is contained in:
@@ -105,6 +105,7 @@ linters:
|
||||
- typecheck
|
||||
- unconvert
|
||||
- unused
|
||||
- usestdlibvars
|
||||
|
||||
run:
|
||||
go: '1.22'
|
||||
|
||||
@@ -334,7 +334,7 @@ func requestRegistryToken(imageRef name.Reference, baseDir string, opt registryO
|
||||
}
|
||||
|
||||
// Get a registry token
|
||||
req, err := http.NewRequest("GET", fmt.Sprintf("%s/auth", opt.AuthURL), nil)
|
||||
req, err := http.NewRequest(http.MethodGet, fmt.Sprintf("%s/auth", opt.AuthURL), nil)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
|
||||
@@ -703,7 +703,7 @@ func (p *Parser) remoteRepoRequest(repo string, paths []string) (*http.Request,
|
||||
paths = append([]string{repoURL.Path}, paths...)
|
||||
repoURL.Path = path.Join(paths...)
|
||||
|
||||
req, err := http.NewRequest("GET", repoURL.String(), http.NoBody)
|
||||
req, err := http.NewRequest(http.MethodGet, repoURL.String(), http.NoBody)
|
||||
if err != nil {
|
||||
return nil, xerrors.Errorf("unable to create HTTP request: %w", err)
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package apigateway
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
@@ -72,7 +73,7 @@ resource "aws_apigatewayv2_domain_name" "example" {
|
||||
{
|
||||
Methods: []v1.Method{
|
||||
{
|
||||
HTTPMethod: String("GET"),
|
||||
HTTPMethod: String(http.MethodGet),
|
||||
AuthorizationType: String("NONE"),
|
||||
APIKeyRequired: Bool(false),
|
||||
},
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package apigateway
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"testing"
|
||||
|
||||
"github.com/aquasecurity/trivy/internal/testutil"
|
||||
@@ -35,7 +36,7 @@ resource "aws_api_gateway_method" "example" {
|
||||
`,
|
||||
expected: []v1.Method{
|
||||
{
|
||||
HTTPMethod: String("GET"),
|
||||
HTTPMethod: String(http.MethodGet),
|
||||
AuthorizationType: String("NONE"),
|
||||
APIKeyRequired: Bool(false),
|
||||
},
|
||||
@@ -63,7 +64,7 @@ resource "aws_api_gateway_method" "example" {
|
||||
`,
|
||||
expected: []v1.Method{
|
||||
{
|
||||
HTTPMethod: String("GET"),
|
||||
HTTPMethod: String(http.MethodGet),
|
||||
AuthorizationType: String("NONE"),
|
||||
APIKeyRequired: Bool(true),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user