mirror of
https://github.com/FiloSottile/age.git
synced 2026-01-07 04:26:20 +00:00
@@ -94,7 +94,11 @@ func main() {
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to open output file %q: %v", outFlag, err)
|
||||
}
|
||||
defer f.Close()
|
||||
defer func() {
|
||||
if err := f.Close(); err != nil {
|
||||
log.Fatalf("Failed to close output file %q: %v", outFlag, err)
|
||||
}
|
||||
}()
|
||||
out = f
|
||||
}
|
||||
|
||||
|
||||
@@ -184,7 +184,11 @@ func main() {
|
||||
}
|
||||
if name := outFlag; name != "" && name != "-" {
|
||||
f := newLazyOpener(name)
|
||||
defer f.Close()
|
||||
defer func() {
|
||||
if err := f.Close(); err != nil {
|
||||
logFatalf("Error: failed to close output file %q: %v", name, err)
|
||||
}
|
||||
}()
|
||||
out = f
|
||||
} else if term.IsTerminal(int(os.Stdout.Fd())) {
|
||||
if name != "-" {
|
||||
|
||||
Reference in New Issue
Block a user