From f095de58dbae5b3f32141af15d5eee0006146022 Mon Sep 17 00:00:00 2001 From: Chris Berry Date: Thu, 19 Sep 2024 10:47:39 +0100 Subject: [PATCH] Fix lint --- license-updater/licenseupdater.go | 9 +++++---- services/accountmanager/utils/utils.go | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/license-updater/licenseupdater.go b/license-updater/licenseupdater.go index 9f798d1..c99ef0e 100644 --- a/license-updater/licenseupdater.go +++ b/license-updater/licenseupdater.go @@ -15,13 +15,14 @@ package main import ( "encoding/json" - "github.com/spf13/pflag" - "github.com/spf13/viper" "io/fs" "log" "os" "path/filepath" "strings" + + "github.com/spf13/pflag" + "github.com/spf13/viper" ) func main() { @@ -37,7 +38,7 @@ func main() { licenseString := getLicenseString(workingDir) var files []string - walkFunc := func(path string, info fs.DirEntry, err error) error { + walkFunc := func(path string, info fs.DirEntry, _ error) error { if !info.IsDir() && strings.HasSuffix(path, ".go") { files = append(files, path) } @@ -78,7 +79,7 @@ func updateFileWithLicense(filePath, licenseString string) error { newContents += line + "\n" } } - err = os.WriteFile(filePath, []byte(newContents), 0644) + err = os.WriteFile(filePath, []byte(newContents), 0o600) if err != nil { return err } diff --git a/services/accountmanager/utils/utils.go b/services/accountmanager/utils/utils.go index 830988d..4061144 100644 --- a/services/accountmanager/utils/utils.go +++ b/services/accountmanager/utils/utils.go @@ -10,6 +10,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. + package utils import apiv1 "github.com/attestantio/go-eth2-client/api/v1"