From 8aa0c769b5124f4a0f59fa0b05ecdd096fbab16e Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Fri, 19 Sep 2014 18:54:12 -0700 Subject: [PATCH] Fixed some linter warnings. --- sysdb/core.go | 2 +- sysdb/store.go | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/sysdb/core.go b/sysdb/core.go index bde2703..edf032c 100644 --- a/sysdb/core.go +++ b/sysdb/core.go @@ -29,8 +29,8 @@ package sysdb // The LogPriority describes the priority of a log message. type LogPriority int +// Log priorities supported by SysDB. const ( - // Log priorities supported by SysDB. LogEmerg = LogPriority(0) LogErr = LogPriority(3) LogWarning = LogPriority(4) diff --git a/sysdb/store.go b/sysdb/store.go index 6f082f3..ffe55d5 100644 --- a/sysdb/store.go +++ b/sysdb/store.go @@ -40,6 +40,9 @@ const jsonTime = `"2006-01-02 15:04:05 -0700"` // sequence of decimal numbers with a unit suffix). type Duration time.Duration +// Common durations. All values greater than or equal to a day are not exact +// values but subject to daylight savings time changes, leap years, etc. They +// are available mostly for providing human readable display formats. const ( Second = Duration(1000000000) Minute = 60 * Second @@ -49,8 +52,8 @@ const ( Year = Duration(3652425 * 24 * 60 * 60 * 100000) ) -// MarshalJSON implements the json.Marshaler interface. The time is a quoted -// string in the SysDB JSON format. +// MarshalJSON implements the json.Marshaler interface. The duration is a +// quoted string in the SysDB JSON format. func (d Duration) MarshalJSON() ([]byte, error) { if d == 0 { return []byte(`"0s"`), nil @@ -177,6 +180,8 @@ func (d Duration) String() string { return time.Duration(d).String() } // (YYYY-MM-DD hh:mm:ss +-zzzz). type Time time.Time +// MarshalJSON implements the json.Marshaler interface. The time is a quoted +// string in the SysDB JSON format. func (t Time) MarshalJSON() ([]byte, error) { return []byte(time.Time(t).Format(jsonTime)), nil } -- 2.30.2