3 ms·
> Use init() to compile any regular expressions and store them as variables within that package No need to resort to init() for regexps, simply use an unexport
by jimsmart 8y ago
> Use init() to compile any regular expressions and store them as variables within that package
No need to resort to init() for regexps, simply use an unexported package level variable:
var validFoo = regexp.MustCompile(...)