Skip to content

Commit

Permalink
set regexes directly in var declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
nleof committed Oct 12, 2017
1 parent 11d8984 commit 736fe14
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions parser_line.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,12 @@ type parsedLine struct {
}

var (
reTag *regexp.Regexp
reComment *regexp.Regexp
)

func init() {
// -- name: $tag
reTag = regexp.MustCompile("^\\s*--\\s*name\\s*:\\s*(.+)")

// -- $comment
reComment = regexp.MustCompile("^\\s*--\\s*(.+)")
}
)

func parseLine(line string) parsedLine {
line = strings.Trim(line, " ")
Expand Down

0 comments on commit 736fe14

Please sign in to comment.