Check error returns to satisfy errcheck lint
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful

This commit is contained in:
benvin
2026-07-25 10:00:07 +10:00
parent e200c0f7d2
commit 7f8ca8046e
2 changed files with 7 additions and 5 deletions
+3 -3
View File
@@ -55,8 +55,8 @@ func main() {
// non-nil error on any failure.
func run(args []string, out io.Writer) error {
if len(args) == 2 && (args[1] == "-v" || args[1] == "--version") {
fmt.Fprintf(out, "encapic %s\n", version)
return nil
_, err := fmt.Fprintf(out, "encapic %s\n", version)
return err
}
if len(args) != 2 {
return fmt.Errorf("usage: %s <certname>", args[0])
@@ -95,7 +95,7 @@ func fetch(baseURL, certname string) ([]byte, error) {
if err != nil {
return nil, fmt.Errorf("request %s: %w", url, err)
}
defer resp.Body.Close()
defer func() { _ = resp.Body.Close() }()
body, err := io.ReadAll(resp.Body)
if err != nil {