Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ linters:
- ineffassign
- lll
- misspell # Detects commonly misspelled English words in comments.
- nakedret
- nakedret # Detects uses of naked returns.
- nilerr # Detects code that returns nil even if it checks that the error is not nil.
- nolintlint # Detects ill-formed or insufficient nolint directives.
- perfsprint # Detects fmt.Sprintf uses that can be replaced with a faster alternative.
Expand Down Expand Up @@ -81,8 +81,9 @@ linters-settings:
lll:
line-length: 200
nakedret:
command: nakedret
pattern: ^(?P<path>.*?\\.go):(?P<line>\\d+)\\s*(?P<message>.*)$
# Disallow naked returns if func has more lines of code than this setting.
# Default: 30
max-func-lines: 0

revive:
rules:
Expand Down
7 changes: 4 additions & 3 deletions cli/command/container/cp.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,10 @@ func runCopy(ctx context.Context, dockerCli command.Cli, opts copyOptions) error
}
}

func resolveLocalPath(localPath string) (absPath string, err error) {
if absPath, err = filepath.Abs(localPath); err != nil {
return
func resolveLocalPath(localPath string) (absPath string, _ error) {
absPath, err := filepath.Abs(localPath)
if err != nil {
return "", err
}
return archive.PreserveTrailingDotOrSeparator(absPath, localPath), nil
}
Expand Down
10 changes: 7 additions & 3 deletions cli/internal/oauth/jwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,19 @@ type Source struct {
}

// GetClaims returns claims from an access token without verification.
func GetClaims(accessToken string) (claims Claims, err error) {
func GetClaims(accessToken string) (Claims, error) {
token, err := parseSigned(accessToken)
if err != nil {
return
return Claims{}, err
}

var claims Claims
err = token.UnsafeClaimsWithoutVerification(&claims)
if err != nil {
return Claims{}, err
}

return
return claims, nil
}

// allowedSignatureAlgorithms is a list of allowed signature algorithms for JWTs.
Expand Down
Loading