Fix Workhorse linter warnings (part 37)
Problem
make golangci
linter detects warnings in following Workhorse files
How to verify
make golangci | grep -E "(^internal/zipartifacts)"
internal/zipartifacts/entry.go:1:1: package-comments: should have a package comment (revive)
internal/zipartifacts/entry.go:7:1: exported: exported function DecodeFileEntry should have comment or be unexported (revive)
internal/zipartifacts/errors.go:18:2: exported: exported var ErrorCode should have comment or be unexported (revive)
internal/zipartifacts/errors.go:1:1: ST1000: at least one file in a package should have a package comment (stylecheck)
internal/zipartifacts/errors_test.go:14:3: expected-actual: need to reverse actual and expected values (testifylint)
internal/zipartifacts/errors_test.go:21:3: expected-actual: need to reverse actual and expected values (testifylint)
internal/zipartifacts/metadata.go:1:1: ST1000: at least one file in a package should have a package comment (stylecheck)
internal/zipartifacts/metadata.go:23:46: exported: comment on exported const MetadataHeaderPrefix should be of the form "MetadataHeaderPrefix ..." (revive)
internal/zipartifacts/metadata.go:24:7: exported: exported const MetadataHeader should have comment or be unexported (revive)
internal/zipartifacts/metadata.go:62:1: exported: exported function GenerateZipMetadata should have comment or be unexported (revive)
internal/zipartifacts/metadata.go:64:20: Error return value of `output.Close` is not checked (errcheck)
internal/zipartifacts/open_archive.go:108:13: Error return value of `file.Close` is not checked (errcheck)
internal/zipartifacts/open_archive.go:1:1: ST1000: at least one file in a package should have a package comment (stylecheck)
internal/zipartifacts/open_archive.go:77:28: response body must be closed (bodyclose)
internal/zipartifacts/open_archive.go:78:2: ifElseChain: rewrite if-else to switch statement (gocritic)
internal/zipartifacts/open_archive.go:90:18: Error return value of `resp.Body.Close` is not checked (errcheck)
internal/zipartifacts/open_archive.go:91:11: Error return value of `rs.Close` is not checked (errcheck)
internal/zipartifacts/open_archive.go:98:15: G304: Potential file inclusion via variable (gosec)
internal/zipartifacts/open_archive_test.go:29:6: shadow: declaration of "err" shadows declaration at line 19 (govet)
Solution
Resolve warnings
Edited by Vasilii Iakliushin