Skip to content

Commit

Permalink
Fix various lint issues (#1010)
Browse files Browse the repository at this point in the history
1. Typo
2. Missing package doc comment
3. Tautological conditional
  • Loading branch information
jonjohnsonjr committed May 13, 2021
1 parent 21a2dc2 commit c03201f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
1 change: 1 addition & 0 deletions internal/and/and_closer.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// Package and provides helpers for adding Close to io.{Reader|Writer}.
package and

import (
Expand Down
3 changes: 2 additions & 1 deletion internal/estargz/estargz.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// Package estargz adapts the containerd estargz package to our abstractions.
package estargz

import (
Expand All @@ -33,7 +34,7 @@ var _ io.ReadCloser = (*estargz.Blob)(nil)
// * An error if the estargz processing encountered a problem.
//
// Refer to estargz for the options:
// https://pkg.go.dev/github.com/containerd/stargz-snapshotter@v0.2.0/estargz#Option
// https://pkg.go.dev/github.com/containerd/stargz-snapshotter/estargz@v0.4.1#Option
func ReadCloser(r io.ReadCloser, opts ...estargz.Option) (*estargz.Blob, v1.Hash, error) {
defer r.Close()

Expand Down
3 changes: 2 additions & 1 deletion internal/gzip/zip.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// Package gzip provides helper functions for interacting with gzipped streams.
package gzip

import (
Expand Down Expand Up @@ -72,7 +73,7 @@ func ReadCloserLevel(r io.ReadCloser, level int) io.ReadCloser {
return pw.CloseWithError(err)
}

// We dont' really care if these fail.
// We don't really care if these fail.
defer pw.Close()
defer r.Close()

Expand Down
2 changes: 2 additions & 0 deletions internal/verify/verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

// Package verify provides a ReadCloser that verifies content matches the
// expected hash values.
package verify

import (
Expand Down
4 changes: 2 additions & 2 deletions pkg/v1/cache/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func (l *lazyLayer) Compressed() (io.ReadCloser, error) {
// Layer found in the cache.
logs.Progress.Printf("Layer %s found (compressed) in cache", digest)
return cl.Compressed()
} else if err != nil && err != ErrNotFound {
} else if err != ErrNotFound {
return nil, err
}

Expand All @@ -99,7 +99,7 @@ func (l *lazyLayer) Uncompressed() (io.ReadCloser, error) {
// Layer found in the cache.
logs.Progress.Printf("Layer %s found (uncompressed) in cache", diffID)
return cl.Uncompressed()
} else if err != nil && err != ErrNotFound {
} else if err != ErrNotFound {
return nil, err
}

Expand Down

0 comments on commit c03201f

Please sign in to comment.