gogrep
gogrep copied to clipboard
match constants based on value as well as syntax
trafficstars
e.g. gogrep 5 should match 2+3 and also the first part of 5+7.
and also, usefully, gogrep 100 should match 100 and 1_0_0. this will help one of the concerns raised near the end of golang.org/issue/28493
I think the simplest way to implement this would be a command which tries its best to simplify or resolve the current expression. It would turn 2+3 into 5, pkg.One + pkg.Two into 3, concatenate strings, and so on.
Initially this would only work on constants, but it would be good if it also worked on "partial" constants. For example, nonConst * 10 * 10 could be simplified into nonConst * 100.