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] Re: Interest in implementing dual-pivot or 3-pivot quicksort for faster sorting?

2017-11-22 Thread Agniva De Sarker
This definitely sounds interesting. Will be glad to help out. On Wednesday, 22 November 2017 23:33:18 UTC+5:30, David McManamon wrote: > > Sometimes it takes years for great technical papers to be implemented. As > a fun exercise to compare Java's dual-pivot (since so much work went into >

Re: [go-nuts] Sharing code on playground disabled.

2017-11-22 Thread Dave Cheney
Please raise a bug with your IP address. https://golang.org/issue/new and it will be escalated to the groups that manage the geoip database -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails

Re: [go-nuts] How to get explicit receiver of a method through reflect?

2017-11-22 Thread Hoping White
Thanks Josh. Yes, a single-method interface can do the job. I just want to know the unsafe way for curiosity. could you please explain more? 2017-11-22 22:12 GMT+08:00 Josh Humphries : > The reflection package provides no way to do this. Even if it were > possible to do

[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",

Re: [go-nuts] Re: Efficient to copy Hash?

2017-11-22 Thread roger peppe
On 22 November 2017 at 18:57, 'simon place' via golang-nuts wrote: > thanks, > > this cloning is an optimisation, slowing it down a lot makes it pointless to > begin with, but luckily really, the program produced has a built-in list of > selectable, std.lib., hash

Re: [go-nuts] question about GO and realtime GC interest by the user community

2017-11-22 Thread David Beberman
Hi John, I don't know what firm realtime means. I did look at GO's GC a bit. I'm not the expert in this, others in my company are. On the question of realtime thread priorities, that is a requirement, as is priority inheritance. For hard realtime systems, you want essentially "unfair"

Re: [go-nuts] Re: Efficient to copy Hash?

2017-11-22 Thread 'simon place' via golang-nuts
thanks, this cloning is an optimisation, slowing it down a lot makes it pointless to begin with, but luckily really, the program produced has a built-in list of selectable, std.lib., hash routines to select from. i will add a warning for someone forking it about this. BTW your improved

[go-nuts] Re: Beginner Question About Structure Initialization

2017-11-22 Thread jlforrest
Thanks for the quick reply! I should have seen that. Sorry for the noise. Jon -- 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

[go-nuts] Re: various odd, to me, at best undocumented, behaviour of automatic formatting in go doc

2017-11-22 Thread 'simon place' via golang-nuts
trying to work around these issues, i find another undocumented 'feature' https://play.golang.org/p/dzcq5XKpgG -- 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

Re: [go-nuts] Beginner Question About Structure Initialization

2017-11-22 Thread Jan Mercl
On Wed, Nov 22, 2017 at 7:03 PM wrote: > ./bad.go:12:18: syntax error: unexpected newline, expecting comma or } Fixed: https://play.golang.org/p/fk_fopK6V1 -- -j -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

[go-nuts] Beginner Question About Structure Initialization

2017-11-22 Thread jlforrest
I'm learning Go (using 1.9.2 on Centos 7). Consider the following trivial program, which works fine: package main import "fmt" type symbol struct { name string fn func(int) options int } func main() { symbols := [] symbol { {"jon",x, 4}, } symbols[0].fn(13)

[go-nuts] x/crypto/ssh/agent: Accept Flags in Agent.Sign()

2017-11-22 Thread KH Cheng
I was trying unsuccessfully to get ssh-agent to sign a JWT via the x/crypto/ssh/agent.Agent::Sign() interface. In https://github.com/golang/crypto/blob/master/ssh/agent/client.go#L371, the Flags in signRequestAgentMsg was left as default (0). req := ssh.Marshal(signRequestAgentMsg{

[go-nuts] Interest in implementing dual-pivot or 3-pivot quicksort for faster sorting?

2017-11-22 Thread David McManamon
Sometimes it takes years for great technical papers to be implemented. As a fun exercise to compare Java's dual-pivot (since so much work went into it) with the 3-pivot described in the paper: Multi-Pivot Quicksort: Theory and Experiments downloaded from:

Re: [go-nuts] Re: lambda syntax

2017-11-22 Thread Tyler Compton
It's usually best to create a new thread instead of responding to one that's so old (more than three years in this case). On Wed, Nov 22, 2017 at 6:28 AM wrote: > I don't know how you can live without Generics but you can't live without > Lambda expression. No Go Authors will

[go-nuts] Re: various odd, to me, at best undocumented, behaviour of automatic formatting in go doc

2017-11-22 Thread 'simon place' via golang-nuts
thanks for looking, you have understood and argued well against my points being significant. i was trying to show-up, and see if there was agreement, that this code could benefit from some re-factoring/simplification. but my problem is; i have an html doc that looks quite poor, but according

Re: [go-nuts] Re: Go Code Debugging

2017-11-22 Thread Tyler Compton
If you're looking for an Eclipse-like IDE experience, you may also want to check out Goland. I don't personally use it but I've heard a lot of good things about it and it has debugging support. On Wed, Nov 22, 2017 at 8:47 AM wrote: > I think it's a nightmare

[go-nuts] Re: Go Code Debugging

2017-11-22 Thread gary . willoughby
I think it's a nightmare to set Eclipse up to support Go. Here's a 20 minute tutorial: https://www.youtube.com/watch?v=v6Wn5gUSEwM If you fancy swapping editor, try Visual Studio Code. It's Go support is second to none (just install the Go plugin and you're done) and has excellent debugging

Re: [go-nuts] Cross compiling for BIG ENDIAN arm5te?

2017-11-22 Thread Ian Lance Taylor
On Tue, Nov 21, 2017 at 7:43 PM, wrote: > > Wondering if it is possible to compile my Go applications into MSB ELF > binaries for ARM? There appears to be no options and little documentation > regarding endianness support. If MSB is not supported, is it likely to

Re: [go-nuts] Sharing code on playground disabled.

2017-11-22 Thread 'Axel Wagner' via golang-nuts
I don't know, sorry. The filter might also be applied to other IP ranges (e.g. Tor?). I know, that I was, at some point, on a network which had the same problem (I think it was some mobile network? I don't remember), even though I never visited an export restricted country. All I can say is a)

Re: [go-nuts] How to get explicit receiver of a method through reflect?

2017-11-22 Thread Josh Humphries
The reflection package provides no way to do this. Even if it were possible to do with unsafe (not even sure it is, but maybe?), it would be brittle and tied to an undocumented representation of a function and its captured variables. Instead, use a single-method interface. It's easy to create a

Re: [go-nuts] Sharing code on playground disabled.

2017-11-22 Thread mayank jha
Does singapore come under restrictions ? On Nov 22, 2017 10:08 PM, "Axel Wagner" wrote: > AFAIK the Go playground has IP-based restrictions for when you are in an > export-restricted country (like Iran), just like golang.org is not > reachable there. The reason

Re: [go-nuts] Sharing code on playground disabled.

2017-11-22 Thread 'Axel Wagner' via golang-nuts
AFAIK the Go playground has IP-based restrictions for when you are in an export-restricted country (like Iran), just like golang.org is not reachable there. The reason being, that US-laws are forbidding it. There are several threads on golang-nuts and github discussing that, which you can probably

[go-nuts] Re: lambda syntax

2017-11-22 Thread kamyarm
I don't know how you can live without Generics but you can't live without Lambda expression. No Go Authors will not listen to anyone. If I could(because of the project I am working on) I would never use a language like Go and would never look back. There are much better choices out there. On

[go-nuts] Go Code Debugging

2017-11-22 Thread shanthkumar . s079
Hi Go Experts, Could you please share steps to debug go code using breakpoints in eclipse? Does it requires any third party tool.? *Thanks and Regards* *Shantkumar.S* -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from

[go-nuts] Golang on Android

2017-11-22 Thread ivan . matmati
Hi there, I'm sure you already tried to find an apk to run your go code on your Android tablet. Certainly, like me you hit a wall. But I've juste discovered something unnoticed by most of us. You can install golang on Android ! How ? Look at my post : https://www.linkedin.com/groups/3712244

[go-nuts] Sharing code on playground disabled.

2017-11-22 Thread mayank . jha
Is there a reason for disabling it ? -- 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

[go-nuts] Cross compiling for BIG ENDIAN arm5te?

2017-11-22 Thread tobias . visionstream
Hi list, Wondering if it is possible to compile my Go applications into MSB ELF binaries for ARM? There appears to be no options and little documentation regarding endianness support. If MSB is not supported, is it likely to be in the next year or so? Thanks, Tobiz -- You received this

[go-nuts] How to get explicit receiver of a method through reflect?

2017-11-22 Thread Hoping White
Hi, all I known that method of a struct can be a function with explicit receiver, like this type Param struct { v int } func (this *Param) Call() { println(this.v) } p := {v:10} t := p.Call t() I wonder how can I get the receiver p from function t through reflect. Thanks all. -- You

Re: [go-nuts] Re: Efficient to copy Hash?

2017-11-22 Thread roger peppe
On 21 November 2017 at 21:56, 'simon place' via golang-nuts wrote: > i found this code, and use it on hash.Hash > > // copy an interface value using reflect (here for pointers to interfaces) > func clone(i interface{}) interface{} { > indirect :=

[go-nuts] Re: is this safe?

2017-11-22 Thread C Banning
Why not something simple like: https://play.golang.org/p/iAlflMUdEA On Monday, November 20, 2017 at 9:48:31 AM UTC-7, Trig wrote: > > for i, user := range myList { > if user.Disabled { > myList = append(myList[:i], myList[i + 1:]...) // remove user from > return list > } > } > > > Is

[go-nuts] How web site create by golang get client certificate in usb token.

2017-11-22 Thread tuanhoanganh
Hello I am newbie of golang, I am creating a site with golang restful and angularJS. >From ASP WebForm, I can allow user choose certificate in this code: namespace WebX509Certificate2 { public partial class _Default : Page { protected void Page_Load(object sender, EventArgs e)