Re: [go-nuts] ultra slow os.Exec

2019-11-19 Thread miha . vrhovnik
The first wait is on read, the 2nd on futex [pid 20441] read(5, "\0\0\0@\0\0\0\0\20\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 64) = 64 [pid 20441] rt_sigprocmask(SIG_SETMASK, [HUP INT USR1 USR2 ALRM CHLD IO], NULL, 8) = 0 [pid 20441] rt_sigprocmask(SIG_BLOCK, [HUP INT USR1 USR2 ALRM CHL

[go-nuts] Re: Problem with migration to the new "module" technology from "go"

2019-11-19 Thread Henry
You need to tell go module where to find the library. It defaults to using central repositories (such as github). If you have the library in the local machine, you can add into your go.mod file something like this: ``` replace namespace/to/pkgname => local/path/to/pkgname ``` When you run 'go i

Re: [go-nuts] mutual TLS authentication (sometimes)

2019-11-19 Thread burak serdar
On Tue, Nov 19, 2019 at 6:31 PM Matthew Zimmerman wrote: > > I can authenticate users via certificate with tls.Config and > RequireAndVerifyClientCert to my CA, that's working just fine. > > What I'd like to do however is to *only* require and verify the cert if they > don't have a valid session

[go-nuts] mutual TLS authentication (sometimes)

2019-11-19 Thread Matthew Zimmerman
I can authenticate users via certificate with tls.Config and RequireAndVerifyClientCert to my CA, that's working just fine. What I'd like to do however is to *only* require and verify the cert if they don't have a valid session cookie. I know that the session is only available after TLS, but the

Re: [go-nuts] ultra slow os.Exec

2019-11-19 Thread Ian Lance Taylor
On Tue, Nov 19, 2019 at 11:45 AM wrote: > > > Doesn't seem to happen with a exec of "/usr/bin/date" so it is most likely > > something wine+Go specific. > Yeah, I did try catting the file and it was fast enough. So you are probably > right. > > Whats interesting is if I do it indirectly via shel

Re: [go-nuts] ultra slow os.Exec

2019-11-19 Thread miha . vrhovnik
> Doesn't seem to happen with a exec of "/usr/bin/date" so it is most likely something wine+Go specific. Yeah, I did try catting the file and it was fast enough. So you are probably right. Whats interesting is if I do it indirectly via shell script (then this is only 5 times slower not 28): Bu

Re: [go-nuts] go vet error on generated code by Swig

2019-11-19 Thread Vishnu
Thanks Ian. Yeah. I am generating those files and committing them. I will try the option you suggested On Tuesday, November 19, 2019 at 8:23:02 AM UTC-8, Ian Lance Taylor wrote: > > On Tue, Nov 19, 2019 at 7:17 AM Vishnu > > wrote: > > > > Sorry. Yes, I was trying to modify the code to see if

[go-nuts] go/types: types.Named hides intermediate names

2019-11-19 Thread Stephen Searles
I'm not sure if this could be considered a bug or not, but it's unfortunate behavior for certain patterns of type analysis. The problem is with a type like: type X time.Time When you inspect type X, you find that it is analyzed as a types.Named. Its immediate underlying type is a types.Struct.

Re: [go-nuts] ultra slow os.Exec

2019-11-19 Thread Robert Engels
-Original Message- >From: Robert Engels >Sent: Nov 19, 2019 10:54 AM >To: Ian Lance Taylor , miha.vrhov...@gmail.com >Cc: golang-nuts >Subject: Re: [go-nuts] ultra slow os.Exec > > >I am guessing - because it is close to 30 secs (which sounds a lot like a >timeout value) - that th

[go-nuts] Re: Need help with godbus.

2019-11-19 Thread Ken Bassford
On Tuesday, November 19, 2019 at 11:21:17 AM UTC-5, Ken Bassford wrote: > > Hi Folks, > > I have been trying to implement godbus's Export function to no avail. > Looking at server.go (under the examples folder) is not very helpful as an > inspection of export.go contains what appear to be chea

Re: [go-nuts] ultra slow os.Exec

2019-11-19 Thread Robert Engels
I am guessing - because it is close to 30 secs (which sounds a lot like a timeout value) - that there is some problem in hand-off with the file descriptors and the descriptor is getting locked, causing some sort of timeout. If it was "any exe" I'm sure someone would of reported it before. It s

Re: [go-nuts] ultra slow os.Exec

2019-11-19 Thread Ian Lance Taylor
On Tue, Nov 19, 2019 at 7:29 AM wrote: > > Robert is right, all 3 examples are the same (they execute the same command > with wine being set up and then teared down again). wine itself is not an > issue. It's go's exec that does something extremely funny. Sorry, I misread the original note. Bu

Re: [go-nuts] go vet error on generated code by Swig

2019-11-19 Thread Ian Lance Taylor
On Tue, Nov 19, 2019 at 7:17 AM Vishnu wrote: > > Sorry. Yes, I was trying to modify the code to see if the error goes away. > > type swig_gostring struct { p uintptr; n int } > func swigCopyString(s string) string { > p := *(*swig_gostring)(unsafe.Pointer(&s)) > r := string((*[0x7fff]byte

[go-nuts] Need help with godbus.

2019-11-19 Thread Ken Bassford
Hi Folks, I have been trying to implement godbus's Export function to no avail. Looking at server.go (under the examples folder) is not very helpful as an inspection of export.go contains what appear to be cheater functions that enable the example to work. Rename "Foo" to "Ping and it fails.

[go-nuts] New GraphQL server library for Go

2019-11-19 Thread Ross Light
Hey gophers, I wanted to share a new GraphQL server library that I've been working on. The project is at github.com/zombiezen/graphql-server, and you can read the announcement blog post for the motivation behind it and how

Re: [go-nuts] ultra slow os.Exec

2019-11-19 Thread miha . vrhovnik
Robert is right, all 3 examples are the same (they execute the same command with wine being set up and then teared down again). wine itself is not an issue. It's go's exec that does something extremely funny. BR, Miha On Tuesday, November 19, 2019 at 4:22:47 PM UTC+1, Robert Engels wrote: > > >

Re: [go-nuts] ultra slow os.Exec

2019-11-19 Thread Robert Engels
I think the point the OP is making is that when he runs the command from the Linux command line it completes in 2 sec - so the Wine startup time should not be the issue. -Original Message- >From: Ian Lance Taylor >Sent: Nov 19, 2019 9:15 AM >To: miha.vrhov...@gmail.com >Cc: golang-nu

Re: [go-nuts] go vet error on generated code by Swig

2019-11-19 Thread Vishnu
Sorry. Yes, I was trying to modify the code to see if the error goes away. type swig_gostring struct { p uintptr; n int } func swigCopyString(s string) string { p := *(*swig_gostring)(unsafe.Pointer(&s)) r := string((*[0x7fff]byte)(unsafe.Pointer(p.p))[:p.n]) // This line gives the go ve

Re: [go-nuts] ultra slow os.Exec

2019-11-19 Thread Ian Lance Taylor
On Tue, Nov 19, 2019 at 6:52 AM wrote: > > I'm running windows cli exe on linux via wine using os.Exec command.. this > takes 28s to complete. > If I run the same command via linux cli it takes 2s to complete, if I run the > same command via php's exec it also takes about 2 seconds to complete.

Re: [go-nuts] Golang and EOL of Windows 7 (Windows Server 2008)

2019-11-19 Thread Ian Lance Taylor
On Tue, Nov 19, 2019 at 6:20 AM Pier-Hugues Pellerin wrote: > > Yes running an old version is a solution but this will mean that we might > miss some important security fixes. That is true, but honestly I would worry more about missing security fixes for Windows than I would about Go. Not that

[go-nuts] ultra slow os.Exec

2019-11-19 Thread miha . vrhovnik
Hey, I'm running windows cli exe on linux via wine using os.Exec command.. this takes 28s to complete. If I run the same command via linux cli it takes 2s to complete, if I run the same command via php's exec it also takes about 2 seconds to complete. == linux cli == time WINEDEBUG=err-all,fi

Re: [go-nuts] go vet error on generated code by Swig

2019-11-19 Thread Ian Lance Taylor
On Tue, Nov 19, 2019 at 5:43 AM Vishnu wrote: > > Hi, I am using swig to generate a go wrapper for one of my projects. I am > seeing the following error in generated code. Is there any workaround for > this? > > type swig_gostring struct { p uintptr; n int } > func swigCopyString(s string) strin

Re: [go-nuts] Golang and EOL of Windows 7 (Windows Server 2008)

2019-11-19 Thread 'Pier-Hugues Pellerin' via golang-nuts
Thanks both of you. Yes running an old version is a solution but this will mean that we might miss some important security fixes. Anywhere I can subscribe for theses kind of discussion? On Mon, Nov 18, 2019 at 1:36 PM Ian Lance Taylor wrote: > On Mon, Nov 18, 2019 at 10:13 AM 'Pier-Hugues Pelle

[go-nuts] go vet error on generated code by Swig

2019-11-19 Thread Vishnu
Hi, I am using swig to generate a go wrapper for one of my projects. I am seeing the following error in generated code. Is there any workaround for this? type swig_gostring struct { p uintptr; n int } func swigCopyString(s string) string { p := *(*swig_gostring)(unsafe.Pointer(&s)) up := uns

[go-nuts] eg-based pkg/errors to x/xerrors migration tool?

2019-11-19 Thread Sebastien Binet
hi there, before I try my hand to this, has anyone already written an eg-based tool to (almost?) entirely automatically migrate a package from pkg/errors to x/xerrors? non eg-based tools also accepted :) cheers, -s -- You received this message because you are subscribed to the Google Groups "

Re: [go-nuts] Unit testing AMQP/build flags for tests

2019-11-19 Thread Sebastien Binet
On Tue, Nov 19, 2019 at 6:37 AM burak serdar wrote: > On Mon, Nov 18, 2019 at 10:24 PM Shane H wrote: > > > > > > > > On Tuesday, November 19, 2019 at 4:11:52 PM UTC+11, burak serdar wrote: > >> > >> > >> > >> This is what I usually do in these situations: > >> > >> var amqpDial=amqp.Dial > >>