If the argument t is "time.Time", a crash occured with a message like this :
parameter '%!s(int64=1421794800)' does not represent time in line VRULE:%!s(int64=1421794800)#ff0000
You shouldn't use "%s" parameter in Sprintf because v.Unix() return int64, not a string
func (g *Grapher) VRule(t interface{}, color string, options ...string) {
if v, ok := t.(time.Time); ok {
t = v.Unix()
}
vr := fmt.Sprintf("VRULE:%s#%s", t, color)
g.push(vr, options)
}
If the argument t is "time.Time", a crash occured with a message like this : parameter '%!s(int64=1421794800)' does not represent time in line VRULE:%!s(int64=1421794800)#ff0000
You shouldn't use "%s" parameter in Sprintf because v.Unix() return int64, not a string
func (g *Grapher) VRule(t interface{}, color string, options ...string) { if v, ok := t.(time.Time); ok { t = v.Unix() } vr := fmt.Sprintf("VRULE:%s#%s", t, color) g.push(vr, options) }