Enable durations to be specified without “” marks
This commit is contained in:
parent
4d9f9b297e
commit
b5c8b21eb6
1 changed files with 4 additions and 0 deletions
|
@ -547,6 +547,10 @@ func (s *scanner) scanNumber(chp ...rune) (tok Token, lit string, val interface{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if val, err := time.ParseDuration(buf.String()); err == nil {
|
||||||
|
return DURATION, buf.String(), val
|
||||||
|
}
|
||||||
|
|
||||||
return tok, buf.String(), nil
|
return tok, buf.String(), nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue