Skip to content

Commit

Permalink
remove TrimSuffix and replaced with trimspace
Browse files Browse the repository at this point in the history
  • Loading branch information
paragjain0910 committed Nov 28, 2024
1 parent 316503a commit 8943dd7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/suseconnect/suseconnect.go
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ func readTokenFromReader(reader io.Reader) (string, error) {
if err != nil && err != io.EOF {
return "", fmt.Errorf("failed to read token from reader: %w", err)
}
token := strings.TrimSuffix(tokenBytes, "\n")
token := strings.TrimSpace(tokenBytes)
if token == "" {
return "", fmt.Errorf("error: token cannot be empty after reading")
}
Expand Down

0 comments on commit 8943dd7

Please sign in to comment.