Skip to content

Commit

Permalink
Remove shadowing warning when password-only (gopasspw#2245)
Browse files Browse the repository at this point in the history
RELEASE_NOTES=[BUGFIX] Removing shadowing warning when using -o/--password

Fixing linter too

Fixes gopasspw#1961

Signed-off-by: Yolan Romailler <anomalroil@users.noreply.github.com>
  • Loading branch information
AnomalRoil authored May 31, 2022
1 parent fc8c9a2 commit f92971c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions internal/action/otp.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ func waitForKeyPress(ctx context.Context, cancel context.CancelFunc) {
}
}

//nolint: cyclop
func (s *Action) otp(ctx context.Context, name, qrf string, clip, pw, recurse bool) error {
sec, err := s.Store.Get(ctx, name)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion internal/action/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func (s *Action) show(ctx context.Context, c *cli.Context, name string, recurse
return s.List(c)
}

if s.Store.IsDir(ctx, name) && ctxutil.IsTerminal(ctx) {
if s.Store.IsDir(ctx, name) && ctxutil.IsTerminal(ctx) && !IsPasswordOnly(ctx) {
out.Warningf(ctx, "%s is a secret and a folder. Use 'gopass show %s' to display the secret and 'gopass list %s' to show the content of the folder", name, name, name)
}

Expand Down

0 comments on commit f92971c

Please sign in to comment.