1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

all: remove nil check for slices

Signed-off-by: Elena Morozova <lelenanam@gmail.com>
This commit is contained in:
Elena Morozova 2016-10-13 13:55:38 -07:00
parent f1e5349a03
commit ace53bbe65
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 return true
} }
if sources == nil || len(sources) == 0 { if len(sources) == 0 {
return false return false
} }

View file

@ -36,7 +36,7 @@ func (overlayWhiteoutConverter) ConvertWrite(hdr *tar.Header, path string, fi os
if err != nil { if err != nil {
return err 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 // create a header for the whiteout file
// it should inherit some properties from the parent, but be a regular file // it should inherit some properties from the parent, but be a regular file
*hdr = tar.Header{ *hdr = tar.Header{

View file

@ -302,7 +302,7 @@ func overlayDeletedFile(root, path string, fi os.FileInfo) (string, error) {
if err != nil { if err != nil {
return "", err return "", err
} }
if opaque != nil && len(opaque) == 1 && opaque[0] == 'y' { if len(opaque) == 1 && opaque[0] == 'y' {
return path, nil 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) 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) return "", fmt.Errorf("no available advertise IP address in interface (%s)", advertise)
} }