Re: [go-nuts] globals defined by stringer utility

2018-05-08 Thread Mark Nahabedian
Thanks Rob. I wasn't concerned with the format if the code but of the (admittedly unlikely) chance that other code could accidentally collide with those globals. On May 8, 2018 2:35 AM, Rob Pike wrote: I don't see that it matters much either way. It's clean enough as it is. It's generated co

Re: [go-nuts] globals defined by stringer utility

2018-05-07 Thread Rob Pike
I don't see that it matters much either way. It's clean enough as it is. It's generated code, after all, and therefore is allowed to be ugly. Its merit is not in the prettiness of the code it generates but in other aspects, such as efficiency of both machine and programmer. There may be one small

[go-nuts] globals defined by stringer utility

2018-05-05 Thread naha
I just learned about the stringer utility from Rob Pike's atricle about generate (https://blog.golang.org/generate). I was wondering why the code generated by stringer has it's data in global variables (example from the article) const _Pill_name = "PlaceboAspirinIbuprofenParacetamol" var _Pill