Merge pull request #27365 from morelena/remove_nil_check

all: remove nil check for slices
Upstream-commit: 245bd4c3d2594fae3fd5099f29eef528a4c4accd
Component: engine
This commit is contained in:
Aaron Lehmann
2016-10-13 15:27:37 -07:00
committed by GitHub
4 changed files with 4 additions and 4 deletions

View File

@ -165,7 +165,7 @@ func (filters Args) MatchKVList(field string, sources map[string]string) bool {
return true
}
if sources == nil || len(sources) == 0 {
if len(sources) == 0 {
return false
}

View File

@ -36,7 +36,7 @@ func (overlayWhiteoutConverter) ConvertWrite(hdr *tar.Header, path string, fi os
if err != nil {
return err
}
if opaque != nil && len(opaque) == 1 && opaque[0] == 'y' {
if len(opaque) == 1 && opaque[0] == 'y' {
// create a header for the whiteout file
// it should inherit some properties from the parent, but be a regular file
*hdr = tar.Header{

View File

@ -302,7 +302,7 @@ func overlayDeletedFile(root, path string, fi os.FileInfo) (string, error) {
if err != nil {
return "", err
}
if opaque != nil && len(opaque) == 1 && opaque[0] == 'y' {
if len(opaque) == 1 && opaque[0] == 'y' {
return path, nil
}
}

View File

@ -69,7 +69,7 @@ func ParseAdvertise(advertise string) (string, error) {
return "", fmt.Errorf("unable to get advertise IP address from interface (%s) : %v", advertise, err)
}
if addrs == nil || len(addrs) == 0 {
if len(addrs) == 0 {
return "", fmt.Errorf("no available advertise IP address in interface (%s)", advertise)
}