all: remove nil check for slices
@@ -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
@@ -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{
@@ -302,7 +302,7 @@ func overlayDeletedFile(root, path string, fi os.FileInfo) (string, error) {
return "", err
return path, nil
@@ -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)