Skip to content

Commit

Permalink
use camel casing instead of underscore
Browse files Browse the repository at this point in the history
  • Loading branch information
jvshahid committed Jul 29, 2014
1 parent 67f9869 commit e8f7503
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions parser/query_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,19 +209,19 @@ func (self *BasicQuery) GetEndTime() time.Time {
// parse time that matches the following format:
// 2006-01-02 [15[:04[:05[.000]]]]
// notice, hour, minute and seconds are optional
var time_regex *regexp.Regexp
var timeRegex *regexp.Regexp

func init() {
var err error
time_regex, err = regexp.Compile(
timeRegex, err = regexp.Compile(
"^([0-9]{4}|[0-9]{2})-[0-9]{1,2}-[0-9]{1,2}( [0-9]{1,2}(:[0-9]{1,2}(:[0-9]{1,2}?(\\.[0-9]+)?)?)?)?$")
if err != nil {
panic(err)
}
}

func parseTimeString(t string) (*time.Time, error) {
submatches := time_regex.FindStringSubmatch(t)
submatches := timeRegex.FindStringSubmatch(t)
if len(submatches) == 0 {
return nil, fmt.Errorf("%s isn't a valid time string", t)
}
Expand Down

0 comments on commit e8f7503

Please sign in to comment.