archive: New() can't fail, so don't return an error type
It could fail if the system can't allocate memory or something undeterministic like that, but in that case it's best to just let the runtime panic.
This commit is contained in:
@@ -152,10 +152,7 @@ func generateArchive(name string, format archive.CompressFormat, level archive.C
|
||||
log.Printf("- Using compression format %s with level %q\n", format, level)
|
||||
|
||||
defer misc.TimeFunc(time.Now(), name)
|
||||
a, err := archive.New(format, level)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
a := archive.New(format, level)
|
||||
|
||||
fs := initramfs.New(features)
|
||||
if err := a.AddItems(fs); err != nil {
|
||||
|
Reference in New Issue
Block a user