Skip to content

Use regexp compile#211

Closed
CallanTaylor wants to merge 3 commits intoFiloSottile:masterfrom
CallanTaylor:use-regexp-compile
Closed

Use regexp compile#211
CallanTaylor wants to merge 3 commits intoFiloSottile:masterfrom
CallanTaylor:use-regexp-compile

Conversation

@CallanTaylor
Copy link
Copy Markdown

The regexp.MustCompile function panics if the regex fails to compile and should only be used in globals or init functions. Instead use regexp.Compile and check err is nil.

@FiloSottile
Copy link
Copy Markdown
Owner

Thank you, but this is a static well-tested regex, I am comfortable with the simpler thing.

@FiloSottile FiloSottile closed this Nov 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants