golint cleanups.

This commit is contained in:
2017-11-16 08:32:05 -08:00
parent d083a39a7d
commit cb16cfa183
6 changed files with 19 additions and 10 deletions

View File

@@ -8,10 +8,17 @@ type File struct {
*LogWriter
}
func (fl *File) Close() {
fl.fo.Close()
// Close calls close on the underlying log files.
func (fl *File) Close() error {
if fl.fo != nil {
if err := fl.fo.Close(); err != nil {
return err
}
fl.fo = nil
}
if fl.fe != nil {
fl.fe.Close()
return fl.fe.Close()
}
}

View File

@@ -29,6 +29,7 @@ const (
LevelFatal
)
// DefaultLevel is the default logging level when none is provided.
const DefaultLevel = LevelInfo
// Cheap integer to fixed-width decimal ASCII. Give a negative width

View File

@@ -228,7 +228,7 @@ func (lw *LogWriter) Fatal(actor, event string, attrs map[string]string) {
os.Exit(1)
}
// Fatal emits a message indicating that the system is in an unsuable
// FatalCode emits a message indicating that the system is in an unsuable
// state, and cannot continue to run. The program will exit with the
// exit code speicfied in the exitcode argument.
//
@@ -244,7 +244,7 @@ func (lw *LogWriter) FatalCode(exitcode int, actor, event string, attrs map[stri
os.Exit(exitcode)
}
// Fatal emits a message indicating that the system is in an unsuable
// FatalNoDie emits a message indicating that the system is in an unsuable
// state, and cannot continue to run. The program will not exit; it is
// assumed that the caller has some final clean up to perform.
//