I wrote an expanded explanation for the second option: Exploring alternatives with go run <https://pocketgophers.com/exploring-alternatives-with-go-run/>.
On Saturday, July 22, 2017 at 4:13:27 PM UTC+2, Tong Sun wrote: > > Fabulous! Thanks Nathan! > > On Saturday, July 22, 2017 at 1:41:12 AM UTC-4, Nathan Kerr wrote: >> >> A couple other options: >> >> 1. modify your code, compile, run >> 2. put most of your code in main.go, each specific sort method in a >> separate file (e.g., specific.go) so that go run main.go specific.go will >> use the sorting you need. See https://pocketgophers.com/10-to-instrument/ >> for an example of this setup. >> >> On Friday, July 21, 2017 at 9:31:26 PM UTC+2, Tong Sun wrote: >>> >>> Hi, >>> >>> I've done some searching before posting, so I know there are a few >>> packages out there that can do go eval, but am wondering which one best >>> suits the following purpose -- >>> >>> I want to sort JSON array using Go, because each case would be different >>> for the different JSON arrays that I'm sorting, and this is only for myself >>> (to get the job done), so I want to do it as simple as possible. Thus >>> defining the sort comparing functions on the fly for the very JSON I'm >>> sorting at the moment seems to be the easiest route. >>> >>> Is it so? Any better way to do it? >>> Is https://github.com/sbinet/go-eval still the best package for doing >>> go eval like above? >>> >>> Thanks >>> >>> >>> -- 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.