From 0fd32ffb01490e84a75585f39a64c8eefba8dfa6 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 20 Mar 2023 09:16:54 +0100 Subject: [PATCH] chore(deps): update dependency golangci/golangci-lint to v1.52.0 (#48) --- Makefile | 2 +- git/utils.go | 8 ++------ plugin/impl.go | 12 ++---------- 3 files changed, 5 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index 35f7747..2dd84eb 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ # renovate: datasource=github-releases depName=mvdan/gofumpt GOFUMPT_PACKAGE_VERSION := v0.4.0 # renovate: datasource=github-releases depName=golangci/golangci-lint -GOLANGCI_LINT_PACKAGE_VERSION := v1.51.2 +GOLANGCI_LINT_PACKAGE_VERSION := v1.52.0 EXECUTABLE := drone-git-action diff --git a/git/utils.go b/git/utils.go index 5370921..709c00e 100644 --- a/git/utils.go +++ b/git/utils.go @@ -54,15 +54,11 @@ func WriteSSHKey(privateKey string) error { privpath := filepath.Join(sshpath, "id_rsa") - if err := os.WriteFile( + return os.WriteFile( privpath, []byte(privateKey), strictFilePerm, - ); err != nil { - return err - } - - return nil + ) } // WriteNetrc writes the netrc file. diff --git a/plugin/impl.go b/plugin/impl.go index 7a6c73a..cfa75b4 100644 --- a/plugin/impl.go +++ b/plugin/impl.go @@ -188,11 +188,7 @@ func (p *Plugin) handleInit() error { return nil } - if err := execute(git.Init(p.settings.Repo)); err != nil { - return err - } - - return nil + return execute(git.Init(p.settings.Repo)) } // HandleClone clones remote. @@ -211,11 +207,7 @@ func (p *Plugin) handleClone() error { return err } - if err := execute(git.CheckoutHead(p.settings.Repo)); err != nil { - return err - } - - return nil + return execute(git.CheckoutHead(p.settings.Repo)) } // HandleCommit commits changes locally.