Re: [go-nuts] Does concurrency have some effect over HTTP client?

2020-10-27 Thread Jesper Louis Andersen
On Mon, Oct 26, 2020 at 8:21 PM JuanPablo AJ wrote: > Jesper, > thanks a lot for your email, your answer was a hand in the dark forest of > doubts. > > I will start trying the load generator wrk2. > > About "instrument, profile, observe", yes, I added the gops agent but > until now I don't have a

[go-nuts] Re: Better formatting of struct literals

2020-10-27 Thread David Skinner
I very much like things that improve readability. On Monday, October 26, 2020 at 11:27:23 AM UTC-5 Eric Lindsey wrote: > Recently, I gofmt'ed a block of code in a file and this is what I ended up > with: > > embed := &discordgo.MessageEmbed{ > Color: MembershipEmbedColor, > Description:

Re: [go-nuts] Better generator support

2020-10-27 Thread Li
You can use a closure as a generator: package main import "fmt" func getPositiveOdds( numbers []int, ) ( iter func() (int, bool), ) { iter = func() (ret int, ok bool) { for len(numbers) > 0 { if numbers[0] > 0 && numbers[0]&1 == 1 { ret = numbers[

[go-nuts] Why key.PublicKey.Equal(key.PublicKey) return false ?

2020-10-27 Thread christoph...@gmail.com
I have the following test that fails reporting a key mismatch. func TestKeyEqual(t *testing.T) { key, err := rsa.GenerateKey(rand.Reader, 2048) if err != nil { t.Fatal("failed generating private key: ", err) } if !key.PublicKey.Equal(key.PublicKey) { t.Fatal

[go-nuts] Re: Why key.PublicKey.Equal(key.PublicKey) return false ?

2020-10-27 Thread christoph...@gmail.com
My formulation was not clear. The test fails, and it reports a key mismatch. Le mardi 27 octobre 2020 à 16:21:05 UTC+1, christoph...@gmail.com a écrit : > I have the following test that fails reporting a key mismatch. > > func TestKeyEqual(t *testing.T) { > key, err := rsa.GenerateKey(ra

[go-nuts] Re: Why key.PublicKey.Equal(key.PublicKey) return false ?

2020-10-27 Thread Jason Phillips
The implementation of Equal() expects the PublicKey argument to be a pointer to an rsa.PublicKey. If you do the following it works: if !key.PublicKey.Equal(&key.PublicKey) { t.Fatal("key mismatch") } It should probably be documented as such. On Tuesday, October 27, 2020 at 12:01:53 PM UTC-4

[go-nuts] Trying to call powershell script from Go

2020-10-27 Thread Uzair Ally
Hi, I am getting the following error when I try to call a powershell script from go. undefined: script Here is the code: cmdName := "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe" out, err := exec.Command("cmdName", script.ps1).Output() if err != nil { fmt.Fprintln(os.Stderr,

Re: [go-nuts] Trying to call powershell script from Go

2020-10-27 Thread Ian Lance Taylor
On Tue, Oct 27, 2020 at 9:25 AM Uzair Ally wrote: > > I am getting the following error when I try to call a powershell script from > go. > > undefined: script > > Here is the code: > > cmdName := "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe" > out, err := exec.Command("cmdName"

Re: [go-nuts] Trying to call powershell script from Go

2020-10-27 Thread Uzair Ally
Hi Ian, Yes of course, here is the program. I am trying to use the os/exec package to call powershell then a script which is script.ps1. I have the script.ps1 in the same folder as main.go package main import ( "fmt" "os" "os/exec" ) func main() { cmdName := "C:\\Windows\\System32\\WindowsPow

Re: [go-nuts] Trying to call powershell script from Go

2020-10-27 Thread Marvin Renich
* Uzair Ally [201027 12:25]: > Hi, > > I am getting the following error when I try to call a powershell script > from go. > > undefined: script > > Here is the code: > > cmdName := "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe" > out, err := exec.Command("cmdName", script.ps

Re: [go-nuts] Trying to call powershell script from Go

2020-10-27 Thread Uzair Ally
Hi Marvin, If I add script.ps1 in double quotes and try to run, it tells me cmdName declared but no used. Yes, the script is named script.ps1. The script is not a variable. On Tuesday, October 27, 2020 at 8:22:14 PM UTC+3 Marvin Renich wrote: > * Uzair Ally [201027 12:25]: > > Hi, > > > > I a

Re: [go-nuts] Distributed go testing (running "go test" as a client)

2020-10-27 Thread Craig Silverstein
Thanks Ian, that was very helpful. It looks like ~50% of the time difference is due to `go vet` calls. I didn't explore that any further we don't need a vet-run for our use case; I just disabled it. According to my analysis of the `/usr/bin/time` output, the rest of the time difference is ent

Re: [go-nuts] Trying to call powershell script from Go

2020-10-27 Thread Marvin Renich
* Uzair Ally [201027 13:27]: > Hi Marvin, > > If I add script.ps1 in double quotes and try to run, it tells me cmdName > declared but no used. > Yes, the script is named script.ps1. The script is not a variable. I should have recognized that "cmdName" should be cmdName without the quotes: ou

Re: [go-nuts] Trying to call powershell script from Go

2020-10-27 Thread Ian Lance Taylor
On Tue, Oct 27, 2020 at 10:27 AM Uzair Ally wrote: > > > If I add script.ps1 in double quotes and try to run, it tells me cmdName > declared but no used. > Yes, the script is named script.ps1. The script is not a variable. Your program has basic issues with using the Go language. I recommend th

Re: [go-nuts] Distributed go testing (running "go test" as a client)

2020-10-27 Thread Ian Lance Taylor
On Tue, Oct 27, 2020 at 10:30 AM Craig Silverstein wrote: > > Thanks Ian, that was very helpful. > > It looks like ~50% of the time difference is due to `go vet` calls. I didn't > explore that any further we don't need a vet-run for our use case; I just > disabled it. > > According to my analys

Re: [go-nuts] Trying to call powershell script from Go

2020-10-27 Thread jake...@gmail.com
It might help if you posted an actual runnable program, that you have personally run, and the full output. On Tuesday, October 27, 2020 at 1:26:53 PM UTC-4 mua...@gmail.com wrote: > Hi Marvin, > > If I add script.ps1 in double quotes and try to run, it tells me cmdName > declared but no used.

Re: [go-nuts] Distributed go testing (running "go test" as a client)

2020-10-27 Thread Craig Silverstein
On Tuesday, October 27, 2020 at 10:45:49 AM UTC-7 Ian Lance Taylor wrote: > The linker is definitely slow, though it got faster in 1.15 and will > get faster again in the future 1.16 (I don't know which version you > are running). > We're on go 1.13.1. It's not so much the linker speed I'm co

Re: [go-nuts] Trying to call powershell script from Go

2020-10-27 Thread Uzair Ally
Hi Ian, Thanks for your response! Yeah I'm only getting the error "cmdName declared but not used" when I add script.ps1 in double quotes. If I remove the double quotes from script.ps1 then the only error I see is undefined: script. The variable cmdName is set to call powershell.exe from it's p

Re: [go-nuts] Trying to call powershell script from Go

2020-10-27 Thread Uzair Ally
Hi Jake, The code I posted is the runnable go program just missing the powershell script which is a separate file. Maybe I'm miss understanding? Is there something else I can provide to help you understand further? On Tuesday, October 27, 2020 at 8:48:54 PM UTC+3 jake...@gmail.com wrote: > It

Re: [go-nuts] Trying to call powershell script from Go

2020-10-27 Thread Marvin Renich
* Uzair Ally [201027 14:19]: > Hi Jake, > > The code I posted is the runnable go program just missing the powershell > script which is a separate file. Maybe I'm miss understanding? Is there > something else I can provide to help you understand further? Based on the your original message and t

[go-nuts] mksyscall.pl bug?

2020-10-27 Thread Chris Keller
Hi folks, I'm involved in developing an amateur radio email application called Pat; Pat uses this library for serial I/O. I was trying to update Pat's dependencies when I discovered that the serial library is gett

Re: [go-nuts] mksyscall.pl bug?

2020-10-27 Thread Chris Keller
Never mind, I was able to file https://github.com/golang/go/issues/42241 On Tue, Oct 27, 2020 at 6:55 PM Chris Keller wrote: > Hi folks, > > I'm involved in developing an amateur radio email application called Pat; > Pat uses this library for serial > I/O.