From 26d17907a6383b4a9ba134af29b454dff1141418 Mon Sep 17 00:00:00 2001 From: Chris McGehee Date: Sat, 22 May 2021 10:45:32 -0700 Subject: [PATCH] Fix lint issues: stylecheck linter (#487) Co-authored-by: Naveen <172697+naveensrinivasan@users.noreply.github.com> --- .golangci.yml | 2 +- checks/checkforcontent.go | 4 ++-- checks/frozen_deps.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index c650e7f5..d356b584 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -49,7 +49,7 @@ linters: - sqlclosecheck - staticcheck - structcheck - # - stylecheck + - stylecheck - thelper - tparallel - typecheck diff --git a/checks/checkforcontent.go b/checks/checkforcontent.go index 0f96d929..c14145dc 100644 --- a/checks/checkforcontent.go +++ b/checks/checkforcontent.go @@ -82,7 +82,7 @@ func ExtractFullpath(fn string) (string, bool) { // Using the http.get instead of the lib httpClient because // the default checker.HTTPClient caches everything in the memory and it causes oom. -func getHttpResponse(url string) (*http.Response, error) { +func getHTTPResponse(url string) (*http.Response, error) { //https://securego.io/docs/rules/g107.html //nolint resp, err := http.Get(url) @@ -122,7 +122,7 @@ func CheckFilesContent(checkName, shellPathFnPattern string, url = strings.Replace(url, "{archive_format}", "tarball/", 1) url = strings.Replace(url, "{/ref}", r.GetDefaultBranch(), 1) - resp, err := getHttpResponse(url) + resp, err := getHTTPResponse(url) if err != nil { return checker.MakeRetryResult(checkName, err) } diff --git a/checks/frozen_deps.go b/checks/frozen_deps.go index 4e0530eb..c533c07e 100644 --- a/checks/frozen_deps.go +++ b/checks/frozen_deps.go @@ -153,7 +153,7 @@ func validateGitHubActionWorkflow(path string, content []byte, logf func(s strin Name string `yaml:"name"` Steps []struct { Name string `yaml:"name"` - Id string `yaml:"id"` + ID string `yaml:"id"` Uses string `yaml:"uses"` } }