k-capehart / go-salesforce

Salesforce REST API client written in Go
https://pkg.go.dev/github.com/k-capehart/go-salesforce/v2
MIT License
31 stars 6 forks source link

fix linting error: printf-style function with dynamic format string and no further arguments should use print-style function instead #60

Closed k-capehart closed 2 months ago

codecov-commenter commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 87.84%. Comparing base (5096c4d) to head (eab0a85). Report is 2 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #60 +/- ## ======================================= Coverage 87.84% 87.84% ======================================= Files 6 6 Lines 1111 1111 ======================================= Hits 976 976 Misses 69 69 Partials 66 66 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

ccoVeille commented 2 months ago

t.Fatalf requires a string as it's a wrapper for sprintf

But t.Fatal accepts ...any

https://pkg.go.dev/testing#F.Fatal

So in addition of replacing t.Fatalf(err.Error()) by t.Fatal(err.Error())

You could have used directly t.Fatal(err)

Fatal uses fmt.Sprintln

https://cs.opensource.google/go/go/+/refs/tags/go1.23.1:src/testing/testing.go;l=1080

fmt.Sprintln will call the .Error()

k-capehart commented 2 months ago

@ccoVeille Ahhh. Thanks for that tip!