docs: fix lint issues in examples and tutorials (#759)

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
This commit is contained in:
Carlos Alexandro Becker
2023-06-09 13:33:53 -03:00
committed by GitHub
parent b2d2ac6504
commit b80eb8303b
18 changed files with 47 additions and 66 deletions

View File

@@ -40,7 +40,7 @@ func (pw *progressWriter) Write(p []byte) (int, error) {
}
func getResponse(url string) (*http.Response, error) {
resp, err := http.Get(url)
resp, err := http.Get(url) // nolint:gosec
if err != nil {
log.Fatal(err)
}
@@ -64,7 +64,7 @@ func main() {
fmt.Println("could not get response", err)
os.Exit(1)
}
defer resp.Body.Close()
defer resp.Body.Close() // nolint:errcheck
// Don't add TUI if the header doesn't include content size
// it's impossible see progress without total
@@ -79,7 +79,7 @@ func main() {
fmt.Println("could not create file:", err)
os.Exit(1)
}
defer file.Close()
defer file.Close() // nolint:errcheck
pw := &progressWriter{
total: int(resp.ContentLength),