The nil check before the range loop is redundant

Signed-off-by: Rijnard van Tonder <hi.teresy@gmail.com>
pull/4757/head
Rijnard van Tonder 6 years ago
parent e7d93f231d
commit 5267c0d44a

@ -36,10 +36,8 @@ type Files map[string][]byte
// Given an []*any.Any (the format for files in a chart.Chart), extract a map of files. // Given an []*any.Any (the format for files in a chart.Chart), extract a map of files.
func NewFiles(from []*any.Any) Files { func NewFiles(from []*any.Any) Files {
files := map[string][]byte{} files := map[string][]byte{}
if from != nil { for _, f := range from {
for _, f := range from { files[f.TypeUrl] = f.Value
files[f.TypeUrl] = f.Value
}
} }
return files return files
} }

Loading…
Cancel
Save