You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As you noted _validTagValueRegexp is not used. So we could remove it. @wblakecaldwell does this regex have a purpose?
Since the regex is a static string, we can also use regexp.MustCompile() which does not return an error and will panic if the regex does not compile. But this is exactly what initTagBatch() is doing so we can simplify the declaration to var validTagValueRegexp = regexp.MustCompile(`^[a-zA-Z0-9_-]+$`) and remove initTagBatch() completely.
Each Go file may have its own init() function [1]. I don't think we need init.go to call a bunch of other init functions. Unless there's some dependency and the order is important. But in this case I don't think it does.
This whole init section could be cleaned up:
_validTagValueRegexp
is not used. So we could remove it. @wblakecaldwell does this regex have a purpose?regexp.MustCompile()
which does not return an error and will panic if the regex does not compile. But this is exactly whatinitTagBatch()
is doing so we can simplify the declaration tovar validTagValueRegexp = regexp.MustCompile(`^[a-zA-Z0-9_-]+$`)
and removeinitTagBatch()
completely.init()
function [1]. I don't think we need init.go to call a bunch of other init functions. Unless there's some dependency and the order is important. But in this case I don't think it does.[1] https://go.dev/doc/effective_go#init
Originally posted by @cleroux in #17 (comment)
The text was updated successfully, but these errors were encountered: