Re: [go-nuts] Introspecting a type

2017-11-23 Thread Hein Meling
That's nice work-around! Thank you Jakob! Best regards, :) Hein On Wednesday, November 22, 2017 at 11:27:34 PM UTC-8, Jakob Borg wrote: > > A variable of type [][]Operation has that type and only that type. Your > Concurrent and Sequential types are convertible to []Operation, and this is >

Re: [go-nuts] Introspecting a type

2017-11-22 Thread Jakob Borg
A variable of type [][]Operation has that type and only that type. Your Concurrent and Sequential types are convertible to []Operation, and this is what happens in the assignment. You can probably use interfaces to accomplish what you want. type Operator interface { Operations() []Operation }

[go-nuts] Introspecting a type

2017-11-22 Thread Hein Meling
I have code like this: type TestCase struct { Namestring Description string OrderOp [][]Operation } type Concurrent []Operation type Sequential []Operation With the intent to do things like this: OrderOp: [][]Operation{ Concurrent{ {ID: "A", Name: "Read", ArgumentType: "ReadRequest",