Closed Antonboom closed 9 months ago
I am bad at naming indeed...
And this POC has grown from when I started (I did not know then that fmt.Sprintf("%x"
was used instead of hex.EncodeToString
)
Do not reflect linter nature (what is linter checks, allow, forbid..?)
For me, this linter is meant for faster performance. It is not meant to forbid something bad, just suggest something faster. Do you know other such linters ?
Do not reflect real situation, because suggested fixes contains not only strconv
Indeed, it is more centered around fmt.Sprint*
Do not consistent with existing similar linters (e.g. nosprintfhostport)
So, what about perfsprint
?
Do you know other such linters ?
$ grep 'PresetPerformance' pkg/lint/lintersdb/manager.go -B3 | grep NewConfig
linter.NewConfig(golinters.NewBodyclose()).
linter.NewConfig(golinters.NewMaligned(malignedCfg)).
linter.NewConfig(golinters.NewNoctx()).
linter.NewConfig(golinters.NewPreAlloc(preallocCfg)).
Also https://go-critic.com/overview#checkers-from-the-performance-group
appendCombine
equalFold
hugeParam
indexAlloc
preferDecodeRune
preferFprint
preferStringWriter
preferWriteByte
rangeExprCopy
rangeValCopy
sliceClear
stringXbytes
So, what about
perfsprint
?
Sounds cool. But seems to oblige you to use fmt.Sprintf
, but in a different, special way 😅
Looks worse than your version 👍
@catenacyber, you are an owner :)
I accept any decision. Looks great! 👍
P.S. Probably need change repository settings. I have no idea why CI was not started 🤔
The repository is new, so there is no run yet
Red because of https://github.com/catenacyber/perfsprint/actions/runs/6565343804/job/17833666127
golangci/golangci-lint crit unable to find '1.54.2' - use 'latest' or see https://github.com/golangci/golangci-lint/releases for details
Oh, sorry for typo
v1.54.2
of course
Indeed, just found it and pushed the fix
Hello!
The current name:
strconv
Any other ideas? 🙂