additional error check
This commit is contained in:
parent
f1566184cf
commit
34a4ebfeaa
2
main.go
2
main.go
@ -31,7 +31,7 @@ func main() {
|
||||
|
||||
c := &command{flattener: rootfs.Flatten, Stdout: os.Stdout}
|
||||
if err := c.execute(os.Args[1], os.Args[2]); err != nil {
|
||||
fmt.Printf("Error: %v", err)
|
||||
fmt.Printf("Error: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
os.Exit(0)
|
||||
|
@ -52,6 +52,9 @@ func Flatten(rd io.ReadSeeker, w io.Writer) (_err error) {
|
||||
if err == io.EOF {
|
||||
break
|
||||
}
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if hdr.Typeflag != tar.TypeReg {
|
||||
continue
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user