4 ms·
gofmt -w -r 'interface{} -> any' src Is this a real command? If so, I’m very impressed. Is there any equivalent for c++ and other languages?
by blahgeek 5y ago
gofmt -w -r 'interface{} -> any' src
Is this a real command? If so, I’m very impressed. Is there any equivalent for c++ and other languages?
- linkdd 5y agohttps://linux.die.net/man/1/sed https://linux.die.net/man/1/sed maybe?
- zmj 5y agoYep, it's a rewrite rule: https://pkg.go.dev/cmd/gofmt https://pkg.go.dev/cmd/gofmt The combination of unambiguous syntax and consistently-formatted code results in rewrites producing meaningful diffs (most of the time).
- jamincan 5y ago'cargo fix' will upgrade your code from one Rust edition to the next as well as apply corrections for lint warnings.
- ainar-g 5y agocargo fix is closer to (and possibly inspired by?) go fix[1], imo. [1]: https://pkg.go.dev/cmd/go#hdr-Update_packages_to_use_new_APIs https://pkg.go.dev/cmd/go#hdr-Update_packages_to_use_new_API...
- tjalfi 5y agoIntelliJ, Resharper, and presumably Rider have structural search and replace[0]. It's available for at least C#, Java, and Kotlin. [0] https://www.jetbrains.com/help/idea/structural-search-and-replace.html https://www.jetbrains.com/help/idea/structural-search-and-re...