golint cleanups.
This commit is contained in:
parent
d083a39a7d
commit
cb16cfa183
|
@ -16,7 +16,7 @@ import (
|
|||
"testing"
|
||||
)
|
||||
|
||||
// NoDebug, if set to true, will cause all asserts to be ignored.
|
||||
// NoDebug can be set to true to cause all asserts to be ignored.
|
||||
var NoDebug bool
|
||||
|
||||
func die(what string, a ...string) {
|
||||
|
|
|
@ -14,9 +14,9 @@ var (
|
|||
format = "2006-01-02 15:04" // Format that will be used for times.
|
||||
outFormat = format + " MST" // Output format.
|
||||
tz = "Local" // String descriptor for timezone.
|
||||
fromLoc *time.Location = time.Local // Go time.Location for the named timezone.
|
||||
fromLoc = time.Local // Go time.Location for the named timezone.
|
||||
fromUnix bool // Input times are Unix timestamps.
|
||||
toLoc *time.Location = time.UTC // Go time.Location for output timezone.
|
||||
toLoc = time.UTC // Go time.Location for output timezone.
|
||||
)
|
||||
|
||||
func usage(w io.Writer) {
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
//
|
||||
|
|
|
@ -23,6 +23,7 @@ func (t *Tee) Write(p []byte) (int, error) {
|
|||
return n, nil
|
||||
}
|
||||
|
||||
// Close calls Close on the underlying file.
|
||||
func (t *Tee) Close() error {
|
||||
return t.f.Close()
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue