Skip to content
Merged
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
9 changes: 5 additions & 4 deletions cmd/jwt/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ package main

import (
"encoding/json"
"errors"
"flag"
"fmt"
"io"
Expand Down Expand Up @@ -74,7 +75,7 @@ func start() error {
}

// Helper func: Read input from specified file or stdin
func loadData(p string) ([]byte, error) {
func loadData(p string) (_ []byte, retErr error) {
if p == "" {
return nil, fmt.Errorf("no path specified")
}
Expand All @@ -91,9 +92,9 @@ func loadData(p string) ([]byte, error) {
return nil, err
}
rdr = f
if err := f.Close(); err != nil {
return nil, err
}
defer func() {
retErr = errors.Join(retErr, f.Close())
}()
}
return io.ReadAll(rdr)
}
Expand Down