gosec: add ignore comments for reported issues that can be ignored

```
builder/remotecontext/remote.go:48:        G107: Potential HTTP request made with variable url (gosec)
builder/remotecontext/git/gitutils.go:145: G107: Potential HTTP request made with variable url (gosec)
builder/remotecontext/git/gitutils.go:147: G107: Potential HTTP request made with variable url (gosec)
pkg/fileutils/fileutils_test.go:185:       G303: File creation in shared tmp directory without using ioutil.Tempfile (gosec)
pkg/tarsum/tarsum_test.go:7:               G501: Blacklisted import `crypto/md5`: weak cryptographic primitive (gosec)
pkg/tarsum/tarsum_test.go:9:               G505: Blacklisted import `crypto/sha1`: weak cryptographic primitive (gosec)
```

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2019-08-28 17:07:29 +02:00
parent 80dd489f21
commit 70aef9f502

View File

@ -142,9 +142,9 @@ func supportsShallowClone(remoteURL string) bool {
serviceURL := remoteURL + "/info/refs?service=git-upload-pack"
// Try a HEAD request and fallback to a Get request on error
res, err := http.Head(serviceURL)
res, err := http.Head(serviceURL) // #nosec G107
if err != nil || res.StatusCode != http.StatusOK {
res, err = http.Get(serviceURL)
res, err = http.Get(serviceURL) // #nosec G107
if err == nil {
res.Body.Close()
}