Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Commit

Permalink
Final misc lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Edward Muller committed Sep 9, 2019
1 parent 114a935 commit 5eaf055
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 20 deletions.
6 changes: 3 additions & 3 deletions registry/blob.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ func (registry *Registry) HasBlob(repository string, digest digest.Digest) (bool
}

func (registry *Registry) BlobMetadata(repository string, digest digest.Digest) (distribution.Descriptor, error) {
checkUrl := registry.url("/v2/%s/blobs/%s", repository, digest)
registry.Logf("registry.blob.check url=%s repository=%s digest=%s", checkUrl, repository, digest)
checkURL := registry.url("/v2/%s/blobs/%s", repository, digest)
registry.Logf("registry.blob.check url=%s repository=%s digest=%s", checkURL, repository, digest)

resp, err := registry.Client.Head(checkUrl)
resp, err := registry.Client.Head(checkURL)
if resp != nil {
defer resp.Body.Close()
}
Expand Down
16 changes: 0 additions & 16 deletions registry/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,6 @@ var (
ErrNoMorePages = errors.New("no more pages")
)

func (registry *Registry) getJSON(url string, response interface{}) error {
resp, err := registry.Client.Get(url)
if err != nil {
return err
}
defer resp.Body.Close()

decoder := json.NewDecoder(resp.Body)
err = decoder.Decode(response)
if err != nil {
return err
}

return nil
}

// getPaginatedJSON accepts a string and a pointer, and returns the
// next page URL while updating pointed-to variable with a parsed JSON
// value. When there are no more pages it returns `ErrNoMorePages`.
Expand Down
3 changes: 2 additions & 1 deletion registry/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ func New(registryURL, username, password string) (*Registry, error) {
func NewInsecure(registryURL, username, password string) (*Registry, error) {
transport := &http.Transport{
TLSClientConfig: &tls.Config{
InsecureSkipVerify: true, //nolint:gosec TODO: Why?
// TODO: Why?
InsecureSkipVerify: true, //nolint:gosec
},
}

Expand Down

0 comments on commit 5eaf055

Please sign in to comment.