Fix Workhorse linter warnings (part 11)
Problem
make golangci
linter detects warnings in following Workhorse files
How to verify
make golangci | grep -E "^internal/git/"
internal/git/archive.go:100:18: Error return value of `os.Remove` is not checked (errcheck)
internal/git/archive.go:35:2: var-naming: struct field CommitId should be CommitID (revive)
internal/git/archive.go:43:2: exported: exported var SendArchive should have comment or be unexported (revive)
internal/git/archive.go:53: Function 'Inject' has too many statements (47 > 40) (funlen)
internal/git/archive.go:5:1: package-comments: should have a package comment (revive)
internal/git/archive.go:73:29: Error return value of `cachedArchive.Close` is not checked (errcheck)
internal/git/archive.go:99:23: Error return value of `tempFile.Close` is not checked (errcheck)
internal/git/blob.go:1:1: ST1000: at least one file in a package should have a package comment (stylecheck)
internal/git/blob.go:21:5: exported: exported var SendBlob should have comment or be unexported (revive)
internal/git/diff.go:1: 1-47 lines are duplicate of `internal/git/format-patch.go:1-48` (dupl)
internal/git/diff.go:22:5: exported: exported var SendDiff should have comment or be unexported (revive)
internal/git/error.go:1:1: ST1000: at least one file in a package should have a package comment (stylecheck)
internal/git/error.go:36:4: singleCaseSwitch: should rewrite switch statement to if statement (gocritic)
internal/git/error_test.go:28: File is not `gofmt`-ed with `-s` (gofmt)
internal/git/error_test.go:65: unnecessary trailing newline (whitespace)
internal/git/format-patch.go:1: 1-48 lines are duplicate of `internal/git/diff.go:1-47` (dupl)
internal/git/format-patch.go:22:5: exported: exported var SendPatch should have comment or be unexported (revive)
internal/git/git-http.go:21:2: exported: comment on exported const GitConfigShowAllRefs should be of the form "GitConfigShowAllRefs ..." (revive)
internal/git/git-http.go:26:1: exported: exported function ReceivePack should have comment or be unexported (revive)
internal/git/git-http.go:30:1: exported: exported function UploadPack should have comment or be unexported (revive)
internal/git/git-http.go:5:1: ST1000: at least one file in a package should have a package comment (stylecheck)
internal/git/info-refs.go:1:1: ST1000: at least one file in a package should have a package comment (stylecheck)
internal/git/info-refs.go:20:1: exported: exported function GetInfoRefsHandler should have comment or be unexported (revive)
internal/git/io.go:141:22: Error return value of `tempfile.Close` is not checked (errcheck)
internal/git/io.go:173:17: Error return value of `tempfile.Close` is not checked (errcheck)
internal/git/io.go:1:1: ST1000: at least one file in a package should have a package comment (stylecheck)
internal/git/io_test.go:20:27: unused-parameter: parameter 'b' seems to be unused, consider removing or renaming it as _ (revive)
internal/git/io_test.go:37:38: unused-parameter: parameter 'key' seems to be unused, consider removing or renaming it as _ (revive)
internal/git/io_test.go:89:14: string `test data` has 3 occurrences, make it a constant (goconst)
internal/git/receive-pack.go:1:1: ST1000: at least one file in a package should have a package comment (stylecheck)
internal/git/receive-pack.go:21:16: Error return value of `cw.Flush` is not checked (errcheck)
internal/git/responsewriter.go:1:1: ST1000: at least one file in a package should have a package comment (stylecheck)
internal/git/responsewriter.go:41:6: exported: exported type HttpResponseWriter should have comment or be unexported (revive)
internal/git/responsewriter.go:45:1: exported: exported function NewHttpResponseWriter should have comment or be unexported (revive)
internal/git/responsewriter.go:52:1: exported: exported method HttpResponseWriter.Log should have comment or be unexported (revive)
internal/git/snapshot.go:1:1: ST1000: at least one file in a package should have a package comment (stylecheck)
internal/git/snapshot.go:27:2: exported: exported var SendSnapshot should have comment or be unexported (revive)
internal/git/upload-pack.go:1:1: ST1000: at least one file in a package should have a package comment (stylecheck)
internal/git/upload-pack.go:37:16: Error return value of `cw.Flush` is not checked (errcheck)
internal/git/upload-pack_test.go:32:27: unused-parameter: parameter 'b' seems to be unused, consider removing or renaming it as _ (revive)
internal/git/upload-pack_test.go:70:2: error-is-as: use require.ErrorIs (testifylint)
Solution
Resolve warnings
Edited by Vasilii Iakliushin