Fix Workhorse linter warnings (part 28)
Problem
make golangci
linter detects warnings in following Workhorse files
How to verify
make golangci | grep -E "^internal/upload/(artifacts|body_up)"
internal/upload/artifacts_store_test.go:106:34: string `/url/put` has 3 occurrences, make it a constant (goconst)
internal/upload/artifacts_store_test.go:1:1: package-comments: should have a package comment (revive)
internal/upload/artifacts_upload_test.go:109: unnecessary trailing newline (whitespace)
internal/upload/artifacts_upload_test.go:206:6: len: use require.Len (testifylint)
internal/upload/artifacts_upload_test.go:238:4: len: use require.Len (testifylint)
internal/upload/artifacts_upload_test.go:46:1: cognitive complexity 34 of func `testArtifactsUploadServer` is high (> 20) (gocognit)
internal/upload/artifacts_upload_test.go:79:10: elseif: can replace 'else {if cond {}}' with 'else if cond {}' (gocritic)
internal/upload/artifacts_uploader.go:147:21: Error return value of `writer.WriteField` is not checked (errcheck)
internal/upload/artifacts_uploader.go:1:1: ST1000: at least one file in a package should have a package comment (stylecheck)
internal/upload/artifacts_uploader.go:35:17: `comming` is a misspelling of `coming` (misspell)
internal/upload/artifacts_uploader.go:73:11: G204: Subprocess launched with variable (gosec)
internal/upload/artifacts_uploader.go:81:22: Error return value of `zipMdOut.Close` is not checked (errcheck)
internal/upload/artifacts_uploader.go:83:5: shadow: declaration of "err" shadows declaration at line 77 (govet)
internal/upload/body_uploader.go:1:1: ST1000: at least one file in a package should have a package comment (stylecheck)
internal/upload/body_uploader_test.go:131:3: commentFormatting: put a space between `//` and comment text (gocritic)
internal/upload/body_uploader_test.go:31:20: response body must be closed (bodyclose)
internal/upload/body_uploader_test.go:43:20: response body must be closed (bodyclose)
internal/upload/body_uploader_test.go:75:20: response body must be closed (bodyclose)
Solution
Resolve warnings
Edited by Vasilii Iakliushin