Skip to content
This repository has been archived by the owner on Jul 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #24 from yabetsu93/enh0001
Browse files Browse the repository at this point in the history
few changes
  • Loading branch information
jorinvo committed Jan 1, 2021
2 parents da3717b + bc63590 commit 5ed9c7c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion flags/duration.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ func (d *durationValue) Set(s string) error {
s = s[:is[0]] + s[is[1]:] + strconv.FormatFloat(days*24, 'f', 6, 64) + "h"
}
v, err := time.ParseDuration(s)
if err != nil {
return err
}
*d = durationValue(v)
return err
return nil
}

func (d *durationValue) String() string {
Expand Down
5 changes: 4 additions & 1 deletion flags/unixtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ func (t *unixTime) String() string {

func (t *unixTime) Set(s string) error {
parsed, err := time.Parse(time.UnixDate, s)
if err != nil {
return err
}
*t = unixTime(parsed)
return err
return nil
}

// UnixTime defines a flag for time.Time values formatted as Unix date.
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# :chart_with_upwards_trend: promplot

[![GoDoc](https://godoc.org/qvl.io/promplot?status.svg)](https://godoc.org/qvl.io/promplot)
[![GoDoc](https://godoc.org/qvl.io/promplot?status.svg)](https://pkg.go.dev/qvl.io/promplot)
[![Build Status](https://travis-ci.org/qvl/promplot.svg?branch=master)](https://travis-ci.org/qvl/promplot)
[![Go Report Card](https://goreportcard.com/badge/qvl.io/promplot)](https://goreportcard.com/report/qvl.io/promplot)

Expand Down

0 comments on commit 5ed9c7c

Please sign in to comment.