On Friday, 10 March 2017 10:29:20 UTC+2, hui zhang wrote: > > I want to generate a min func >
Why? That doesn't sound like a good use of time. :P You would probably much faster using keyboard macros or multiple cursors e.g. (real-time) <https://lh3.googleusercontent.com/-5Vz_puoHe7o/WMJukhX878I/AAAAAAAADRI/9nn3cse3gkYrZ--aVfWaofUFGaRb49MtACLcB/s1600/Animation.gif> I'm sure you were solving some other problem than just implementing Min*? Having multiple such func-s is usually a design smell, use one type: int, int32 or int64 and be done with it, rather than trying to implement everything in the universe. If you do decide to go the generation route, which I wouldn't suggest, then see https://blog.golang.org/generate and use text/template https://play.golang.org/p/LCE806P-UJ. There are of course plenty of tools to help you with generation: https://docs.google.com/document/d/1vrAy9gMpMoS3uaVphB32uVXX4pi-HnNjkMEgyAHX4N4/edit#heading=h.42vcqdjeczyu + Egon -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.