butuzov / mirror

Use right mirror functions for string/[]byte performance bust
MIT License
43 stars 2 forks source link

Consider toml.Decode vs toml.Unmarshal #76

Open ccoVeille opened 6 days ago

ccoVeille commented 6 days ago

I thought about your project by reading this PR

https://pkg.go.dev/github.com/BurntSushi/toml#Unmarshal

https://pkg.go.dev/github.com/BurntSushi/toml#Decode

https://github.com/BurntSushi/toml/blob/v1.4.0/decode.go#L24-L37

Could you have interest for supporting it?

butuzov commented 5 days ago

Yeah, it looks its "our" case and @golangci is already have its supported. I will gladly except PR from you or @alexandear if you are going to create one. I will also try to find time once ... once i have chance to sit calmly for an hour.

Cheers!

ccoVeille commented 5 days ago

and golangci is already have its supported

I might have missed something then.

What do you mean?

alexandear commented 4 days ago

As I understand it, the linter mirror is designed to only support finding mirroring functions in the standard library, not in third-party libraries like github.com/BurntSushi/toml.

butuzov commented 4 days ago

Correct! 1) std lib first. However this package supported by main engine (i am considering gonagci-lint main engine for running mirror), so it can be OK to have its support. 2) Issue I see now - Unmarshal and Decode has different signatures, therefore its not really really suitable for mirror (as alt function will need to have almost same signature).