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:
@@ -51,7 +51,7 @@ type Archive struct {
|
||||
items archiveItems
|
||||
}
|
||||
|
||||
func New(format CompressFormat, level CompressLevel) (*Archive, error) {
|
||||
func New(format CompressFormat, level CompressLevel) *Archive {
|
||||
buf := new(bytes.Buffer)
|
||||
archive := &Archive{
|
||||
cpioWriter: cpio.NewWriter(buf),
|
||||
@@ -60,7 +60,7 @@ func New(format CompressFormat, level CompressLevel) (*Archive, error) {
|
||||
compress_level: level,
|
||||
}
|
||||
|
||||
return archive, nil
|
||||
return archive
|
||||
}
|
||||
|
||||
type archiveItem struct {
|
||||
|
Reference in New Issue
Block a user