Add unconvert linter and apply fixes

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
This commit is contained in:
Sascha Grunert 2019-07-18 10:37:38 +02:00
parent 4ae0e14ea8
commit 8e58ba3cdb
No known key found for this signature in database
GPG Key ID: 8CE029DD1A866E52
3 changed files with 5 additions and 5 deletions

View File

@ -23,6 +23,7 @@ linters:
- staticcheck
- structcheck
- typecheck
- unconvert
- unparam
- unused
- varcheck
@ -41,4 +42,3 @@ linters:
# - prealloc
# - scopelint
# - stylecheck
# - unconvert

View File

@ -569,7 +569,7 @@ func runUsingChroot(spec *specs.Spec, bundlePath string, ctty *os.File, stdin io
cmd.UnshareFlags = syscall.CLONE_NEWUTS | syscall.CLONE_NEWNS
requestedUserNS := false
for _, ns := range spec.Linux.Namespaces {
if ns.Type == specs.LinuxNamespaceType(specs.UserNamespace) {
if ns.Type == specs.UserNamespace {
requestedUserNS = true
}
}

View File

@ -184,8 +184,8 @@ func (b *Builder) Commit(ctx context.Context, dest types.ImageReference, options
}
// In case we're using caching, decide how to handle compression for a cache.
// If we're using blob caching, set it up for the source.
var maybeCachedSrc = types.ImageReference(src)
var maybeCachedDest = types.ImageReference(dest)
maybeCachedSrc := src
maybeCachedDest := dest
if options.BlobDirectory != "" {
compress := types.PreserveOriginal
if options.Compression != archive.Uncompressed {
@ -301,7 +301,7 @@ func Push(ctx context.Context, image string, dest types.ImageReference, options
if err != nil {
return nil, "", err
}
var maybeCachedSrc = types.ImageReference(src)
maybeCachedSrc := src
if options.BlobDirectory != "" {
compress := types.PreserveOriginal
if options.Compression != archive.Uncompressed {