Skip to content
This repository was archived by the owner on Feb 16, 2023. It is now read-only.

Commit 02b9cbc

Browse files
committed
Fix lint issues
1 parent 0c92e42 commit 02b9cbc

3 files changed

Lines changed: 7 additions & 5 deletions

File tree

internals/onepassword/onepassword.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ func GetSignInAddress() (string, error) {
109109
path := filepath.Join(home, ".op", "config")
110110
bytes, err := ioutil.ReadFile(path)
111111
if err != nil {
112-
fmt.Errorf("could not read 1password config file at %s", path)
112+
return "", fmt.Errorf("could not read 1password config file at %s", path)
113113
}
114114

115115
config := struct {

internals/secrethub/migrate.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -375,16 +375,16 @@ func isSecretItem(dir *api.Dir) bool {
375375
}
376376

377377
func walkTree(tree *api.Tree, fn func(*api.Dir) error) error {
378-
return walkTreeRec(tree, tree.RootDir, fn)
378+
return walkTreeRec(tree.RootDir, fn)
379379
}
380380

381-
func walkTreeRec(tree *api.Tree, dir *api.Dir, fn func(*api.Dir) error) error {
381+
func walkTreeRec(dir *api.Dir, fn func(*api.Dir) error) error {
382382
err := fn(dir)
383383
if err != nil {
384384
return err
385385
}
386386
for _, subDir := range dir.SubDirs {
387-
err := walkTreeRec(tree, subDir, fn)
387+
err := walkTreeRec(subDir, fn)
388388
if err != nil {
389389
return err
390390
}
@@ -453,7 +453,7 @@ func (cmd *MigrateApplyCommand) Run() error {
453453
if !cmd.append {
454454
confirmed, err := ui.AskYesNo(cmd.io, fmt.Sprintf("A vault named %s already exists. Do you want to append the items to that vault?", vault.Name), ui.DefaultYes)
455455
if err != nil {
456-
return fmt.Errorf("A vault named %s already exists. Use --apend to append to existing vaults", vault.Name)
456+
return fmt.Errorf("a vault named %s already exists. Use --apend to append to existing vaults", vault.Name)
457457
}
458458
if !confirmed {
459459
fmt.Fprintln(cmd.io.Output(), "Aborting.")

internals/secrethub/migrate_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//nolint:dupl
12
package secrethub
23

34
import (
@@ -898,6 +899,7 @@ func TestAddTreeToPlan(t *testing.T) {
898899
}
899900
}
900901

902+
//nolint:unparam
901903
func createTree(rootDir *api.Dir, parentPath string) *api.Tree {
902904
tree := &api.Tree{
903905
RootDir: rootDir,

0 commit comments

Comments
 (0)