[go-nuts] Re: Go eval the source

2017-07-21 Thread Nathan Kerr
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

[go-nuts] Re: Going places

2017-07-21 Thread Brian Ketelsen
Congrats - that's awesome - I beat you by a few years though :) On Friday, July 21, 2017 at 12:03:03 PM UTC-4, Michael Jones wrote: > > Maybe not news, and certainly not big news, but I just filed a patent that > uses Go source code to illustrate logical methods claimed in the invention. > So

[go-nuts] Go eval the source

2017-07-21 Thread Tong Sun
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

[go-nuts] Re: No Allman-Style, No go!

2017-07-21 Thread ecstatic . coder
That's the problem. Indentation style should remain personal, as it's a matter of taste. Every development team should have the right to freely choose which coding standard they will enforce. On Friday, July 21, 2017 at 3:22:50 PM UTC+1, Hrobjartur Thorsteinsson wrote: > > Best just to call

Re: [go-nuts] Going places

2017-07-21 Thread Henrik Johansson
I am feeling slightly ambivalent but cool and congrats! fre 21 juli 2017 kl 18:02 skrev Michael Jones : > Maybe not news, and certainly not big news, but I just filed a patent that > uses Go source code to illustrate logical methods claimed in the invention. > So if it

[go-nuts] Going places

2017-07-21 Thread Michael Jones
Maybe not news, and certainly not big news, but I just filed a patent that uses Go source code to illustrate logical methods claimed in the invention. So if it was not already the case, Go has now been used in patent filings. -- Michael T. Jones michael.jo...@gmail.com -- You received this

Re: [go-nuts] Re: Code Review - Applying functions on custom types

2017-07-21 Thread Sofiane Cherchalli
Hi Rog, Please inline comments. Thx On Thursday, July 20, 2017 at 1:58:09 PM UTC+2, rog wrote: > > I'm not convinced that holding all your values in a uniform way > is going to be that helpful for you. You might be better using reflection > to map the columns into a struct type (there's

Re: [go-nuts] Re: Code Review - Applying functions on custom types

2017-07-21 Thread Sofiane Cherchalli
Hi Rog, Please inline comments. Thx On Thursday, July 20, 2017 at 1:58:09 PM UTC+2, rog wrote: > > I'm not convinced that holding all your values in a uniform way > is going to be that helpful for you. You might be better using reflection > to map the columns into a struct type (there's

[go-nuts] Re: No Allman-Style, No go!

2017-07-21 Thread thorsteinssonh
I don't get it. It's not even true K style. Open brace on function declarations in original K books was always on a new line. It is only conditional expressions that have open braces on same line as the conditional. Just check the book,

[go-nuts] Re: Sorting user defined collection in multiple ways

2017-07-21 Thread Val
Hello Srinivas The traditional way to achieve this in go (as showcased here and here ) is, to : - declare a named type of slice - implement 3 methods Len, Less, Swap

Re: [go-nuts] Sorting user defined collection in multiple ways

2017-07-21 Thread Jan Mercl
On Fri, Jul 21, 2017 at 3:17 PM wrote: > - I have user defined data structure called Employee with attributes "age", name and sal. I want to write three different go functions that sorts based on age, name and sal. Are you sorting a slice?

[go-nuts] Sorting user defined collection in multiple ways

2017-07-21 Thread srinik . kandula
Hi, I have below requirement, could any one suggest on how i can achieve in go lang using https://golang.org/pkg/sort/. - I have user defined data structure called Employee with attributes "age", name and sal. I want to write three different go functions that sorts based on age, name and sal.

Re: [go-nuts] "interface{} says nothing", lets consider it destroys information

2017-07-21 Thread mhhcbon
here is a solution to what i described in previous. The result of func mustNotErr(f func() (, error)) func() () {} is the transitivity of t -to> func (...) (..., *-*error) mustNotErr takes in input a func T with any inputs, and a *traling* error, returns in output, the func T *less* the

[go-nuts] Re: How do you test a server?

2017-07-21 Thread Simon Ritchie
My scaffolding tool generates a web server and some unit and integration tests. The tests use Peter Gotz' mocking framework pegomock. If you generate a server with the scaffolder, you can look at the source code and see how it works. https://github.com/goblimey/scaffolder By the way, not