Thanks, there seems to be a tool already for most things in Go, just wonderful!
Patrik Iselind On Wed, Mar 28, 2018 at 10:54 AM, Ian Davis <m...@iandavis.com> wrote: > On Wed, 28 Mar 2018, at 8:32 AM, Patrik Iselind wrote: > > Is there such a tool that can go through a GoLang code base and suggest > values that might be a good idea to convert into constants? > > If a value (for example an int or a string, but excluding values that are > already constants) is hard coded at least X times in the code base, could > be a candidate for being a constant. > > Having all these hard coded and repeated values as constants would reduce > the risk of typos when typing out the values every time. > > Any suggestions? > > > github.com/jgautheron/goconst works for strings > > Ian > > -- > You received this message because you are subscribed to a topic in the > Google Groups "golang-nuts" group. > To unsubscribe from this topic, visit https://groups.google.com/d/ > topic/golang-nuts/wt1trrfC6og/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > golang-nuts+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.