[go-nuts] Why are can't struct field types not be used as types

2017-12-09 Thread Tamás Gulácsi
x := T{}.F -- 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.

[go-nuts] Re: Why are can't struct field types not be used as types

2017-12-09 Thread florian
> > x := T{}.F Thanks. Good idea. That doesn't work in most cases though (function arguments/returns or type definitions for example). -- 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] Combine low traffic website

2017-12-09 Thread Matthew Zimmerman
You can also code both sites in one go binary then use the sni TLS extension to determine which website to display. This is exactly how Caddy and every other reverse proxy does it. On Fri, Dec 8, 2017, 11:33 PM Andrew wrote: > Thanks, I'll try Caddy first. > > -- > You

Re: [go-nuts] Understanding method pointers

2017-12-09 Thread viktor . ogeman
Sorry about the unclear code, that was just a consequence of simplifying down from the actual use-case, however, to me it seems not to be the same thing. In your example you have one struct and capture a method on that same struct twice, refering to the same - that makes sense. However, in my

[go-nuts] Why are can't struct field types not be used as types

2017-12-09 Thread 'Florian Uekermann' via golang-nuts
type T struct { F struct{ lots, of, fields int } } func main() { var _ T.F } https://play.golang.org/p/qjoKIQ0TAG If T.F just resolved to the underlying type struct{ lots, of, fields int } I could stop littering my code with helper types. Does anyone know if this would create problems? I expect

Re: [go-nuts] Understanding method pointers

2017-12-09 Thread 'Axel Wagner' via golang-nuts
No, the question is actually, why methods bound to *different* pointers, still print the same: https://play.golang.org/p/o2lgZBBYx- The same can be observed for closures (unsurprisingly): https://play.golang.org/p/B6QKQWiraL I don't yet have a conclusive, detailed answer (I tried diving into the

Re: [go-nuts] Understanding method pointers

2017-12-09 Thread Jakob Borg
I confess I find the code a bit convoluted and hard to follow - but doesn’t it just boil down to method values bound to the same pointer, thus acting on the same struct value (state)? https://play.golang.org/p/VVdSyaYp5x //jb On 9 Dec 2017, at 09:23,

Re: [go-nuts] Understanding method pointers

2017-12-09 Thread 'Axel Wagner' via golang-nuts
Is it possible that some of your methods have a value-receiver? In that case, they wouldn't be able to mutate any state; *in* the method they'd have different addresses (as the methods act on a copy), but the variables that you call the method on would have the same address. It is hard to answer

[go-nuts] Understanding method pointers

2017-12-09 Thread viktor . ogeman
Hi, I have a problem that I have tried to reduce to a minimal re-producible example, I have not fully managed but it does show some to me strange behavior: https://play.golang.org/p/ZCyumUPBos I have a similar set up in a much larger set-up where I seem to see (no errors reported by

Re: [go-nuts] Understanding method pointers

2017-12-09 Thread 'Axel Wagner' via golang-nuts
Apologies, I didn't really read the code you posted, so didn't understand the core of your question. Which is an excellent one. I have no idea. I will try to find out, but for now I'm stumped myself :) On Sat, Dec 9, 2017 at 11:12 AM, wrote: > Hi, > > Thanks for the

[go-nuts] Re: net/http Server Shutdown does not free up the port upon return

2017-12-09 Thread asaaveri
Sockets have something called SO_REUSEADDR. BSD libraries, Java and other support this. I would think Go supports this in some form. On Tuesday, November 28, 2017 at 9:53:48 PM UTC-7, Albert Tedja wrote: > > net/http's Shutdown() does not free up the port upon return, or rather it > seems a

[go-nuts] Re: multiple commands in one ssh session

2017-12-09 Thread hiltov
Hi Dominik. Have you finally found the solution? I'm working on similar task to run commands on cisco routers. Could you share you code for this? On Thursday, May 18, 2017 at 1:23:57 PM UTC+3, Dominik Link wrote: > > Hi > > > I would like to run multiple ssh commands within the same 'context'

[go-nuts] Re: Is this legit in cgo -- passing []*C.SQL_ERROR_TYPE to C

2017-12-09 Thread asaaveri
Ian: Thanks. In the real environment, t transform the error message into a JSON document and C.free as soon as the transformation is done. The end user will see the proverbial error interface. With regards, mp On Friday, December 8, 2017 at 10:24:45 AM UTC-7, M.P. Ardhanareeswaran wrote: >

[go-nuts] Any way to run functions in indepent thread/processes?

2017-12-09 Thread shockme
Hi, I'd like to know if there is any way to run go functions in independent threads/process, just like multiprocessing.Pool.apply in python. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving

Re: [go-nuts] Elphaba Chess

2017-12-09 Thread hughaguilar96
On Friday, December 8, 2017 at 11:55:15 PM UTC-7, Filip Zaludek wrote: > > > https://chessprogramming.wikispaces.com/Alpha-Beta Thanks for the link. I read through a lot of the pages. I did find one page that addressed the part I don't understand:

Re: [go-nuts] Understanding method pointers

2017-12-09 Thread viktor . ogeman
Hi, Thanks for the tips, no, I have checked so that all the methods are on pointers so thats not it unfortunately. I do now fully undertand you explanation for why I see the same adress being printed for both actions[1] and actions[2] though? In the playground example they are being called as

[go-nuts] Re: Webservices with Windows Authentication

2017-12-09 Thread ancientlore
I haven't done it, but these two might be a starting point. https://github.com/Azure/go-ntlmssp https://github.com/ThomsonReutersEikon/go-ntlm Mike On Saturday, December 9, 2017 at 5:59:41 PM UTC-5, snmed wrote: > > Hi all > > We are primarly working in a windows environment and developing web

Re: [go-nuts] Re: Errors with uploading large files (> 1gb) - multipart

2017-12-09 Thread seth cohen
Excellent call, my friend. Apparently, `NextPart()` invalidates the previous parts. On Fri, Dec 8, 2017 at 6:01 PM, Dave Cheney wrote: > Perhaps calling next part is consuming reader, so when you break at once > you hit io.EOF, the reader you memorised has been consumed. > >

[go-nuts] Re: Webservices with Windows Authentication

2017-12-09 Thread oldCoderException
I can't comment on authenticating a go client against windoze services, but we use both LDAP and Active Directory (AD) extensively and authenticate our users, as well as add and modify them to those services using Go all the time. We use this excellent package:

[go-nuts] go/math String methods

2017-12-09 Thread gavingrover
Hi In the "math/big" package, the Rat, Int, and Float types only have methods that are attached to their pointer types, including the small handful of them that don't modify the type's data, such as String() and Text(). func (x *Rat) String() { ... } Because I'm working with the

Re: [go-nuts] go/math String methods

2017-12-09 Thread Ian Lance Taylor
On Sat, Dec 9, 2017 at 9:03 PM, wrote: > > In the "math/big" package, the Rat, Int, and Float types only have methods > that are attached to their pointer types, including the small handful of > them that don't modify the type's data, such as String() and Text(). > > func

[go-nuts] Any way to run functions in independent threads/processes in go?

2017-12-09 Thread shockme
Hi, I'd like to know if there is any way to run go functions in independent threads/process, just like multiprocessing.Pool.apply. -- 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