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.