Skip to content

Commit

Permalink
Check for error when using Scanln
Browse files Browse the repository at this point in the history
  • Loading branch information
storvik committed Jul 20, 2024
1 parent a329ea2 commit 572a4b6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cmd/goshrt/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,10 @@ func main() {
case 0:
fmt.Printf("JWT Token: ")
var toknStr string
fmt.Scanln(&toknStr)
_, err := fmt.Scanln(&toknStr)
if err != nil {
return err
}
valid, err := auth.Validate(toknStr)
if err != nil {
return err
Expand Down

0 comments on commit 572a4b6

Please sign in to comment.