mirror of
https://codeberg.org/scip/ts.git
synced 2025-12-16 20:20:57 +01:00
fix linting errs
This commit is contained in:
@@ -18,18 +18,17 @@ const (
|
||||
Usage string = `This is ts, a timestamp tool.
|
||||
|
||||
Usage: ts <time string> [<time string>]
|
||||
-d --diff Calculate difference between two timestamps (default).
|
||||
-a --add Add two timestamps (second parameter must be a time).
|
||||
-f --format For diffs: duration, hour, min, sec, msec.
|
||||
For timestamps: datetime, rfc3339, date, time, unix, string.
|
||||
-d --diff Calculate difference between two timestamps (default)
|
||||
-a --add Add two timestamps (second parameter must be a time)
|
||||
-f --format For diffs: duration, hour, min, sec, msec
|
||||
For timestamps: datetime, rfc3339, date, time, unix, string
|
||||
string is a strftime(1) format string. datetime is
|
||||
the default.
|
||||
-u --unit Add unit to the output of timestamp diffs.
|
||||
--debug Show debugging output.
|
||||
-v --version Show program version.
|
||||
-h --help Show this help screen.
|
||||
-e --examples Show examples or supported inputs.
|
||||
`
|
||||
the default
|
||||
-u --unit Add unit to the output of timestamp diffs
|
||||
--debug Show debugging output
|
||||
-v --version Show program version
|
||||
-h --help Show this help screen
|
||||
-e --examples Show examples or supported inputs`
|
||||
|
||||
Examples string = `Example timestamp inputs:
|
||||
now 10:25:30 Last sunday at 5:30pm 2 weeks ago
|
||||
|
||||
@@ -20,7 +20,10 @@ func Main(output io.Writer) int {
|
||||
}
|
||||
|
||||
if conf.Examples {
|
||||
fmt.Fprintln(output, Examples)
|
||||
_, err := fmt.Fprintln(output, Examples)
|
||||
if err != nil {
|
||||
Die(err)
|
||||
}
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
|
||||
@@ -65,9 +65,7 @@ func (tp *TimestampProccessor) Parse(timestamp string) (time.Time, error) {
|
||||
}
|
||||
|
||||
// now failed, try module dateparse
|
||||
ts, err = dateparse.ParseAny(timestamp)
|
||||
|
||||
return ts, nil
|
||||
return dateparse.ParseAny(timestamp)
|
||||
}
|
||||
|
||||
func (tp *TimestampProccessor) Calc(timestampA, timestampB string) error {
|
||||
|
||||
Reference in New Issue
Block a user