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

Commit

Permalink
few changes
Browse files Browse the repository at this point in the history
  • Loading branch information
yabetsu93 committed Jan 1, 2021
1 parent 9fd0c14 commit 3501209
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
language: go
go_import_path: qvl.io/promplot
go:
- 1.9
- "1.15"
os:
- linux
- osx
Expand Down
6 changes: 5 additions & 1 deletion flags/duration.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package flags

import (
"flag"
"fmt"
"regexp"
"strconv"
"time"
Expand All @@ -20,8 +21,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 fmt.Errorf("failed to parse string time: %v", err)
}
*d = durationValue(v)
return err
return nil
}

func (d *durationValue) String() string {
Expand Down
6 changes: 5 additions & 1 deletion flags/unixtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package flags

import (
"flag"
"fmt"
"time"
)

Expand All @@ -13,8 +14,11 @@ func (t *unixTime) String() string {

func (t *unixTime) Set(s string) error {
parsed, err := time.Parse(time.UnixDate, s)
if err != nil {
return fmt.Errorf("failed to parse string time: %v", 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 3501209

Please sign in to comment.