jgautheron/goconst

Combine matches

mwat56 opened this issue · 3 comments

Using the latest release (see #7) the program prints out all matches like

config.go:240:37:4 other occurrence(s) of "logStack" found in: config.go:241:26 config.go:366:20 config.go:368:20 pagehandler.go:160:31
config.go:241:26:4 other occurrence(s) of "logStack" found in: config.go:240:37  config.go:366:20 config.go:368:20 pagehandler.go:160:31
config.go:366:20:4 other occurrence(s) of "logStack" found in: config.go:240:37 config.go:241:26 config.go:368:20 pagehandler.go:160:31
config.go:368:20:4 other occurrence(s) of "logStack" found in: config.go:240:37 config.go:241:26 config.go:366:20 pagehandler.go:160:31

I'd prefer it if all matches were printed in a single line. (I seem to remember that goconst did that in the previous release.)
Thank you!

Hi @mwat56, this is expected since goconst output is specifically tuned for code editors (therefore each occurrence is shown on a new line). I can add a grouped parameter though if you use goconst directly.

@jgautheron:

goconst output is specifically tuned for code editors (therefore each occurrence is shown on a new line).

Ah! I understand. – I simply noticed that the output needed a huge amount of real estate on my display.

I can add a grouped parameter though if you use goconst directly.

That seems like a good idea!

We now have a grouped flag.