Re: [go-nuts] go clean -h isn't helpful

2024-06-17 Thread Will Faught
> People who already know what the command does can use that short summary to remind themselves of the available options. Which options do you mean? My point was that it doesn't document any options. On Mon, Jun 17, 2024 at 5:57 PM Ian Lance Taylor wrote: > On Mon, Jun 17, 2024 at 5:28 PM will.

Re: [go-nuts] Re: Breaking an io.Pipe loop

2024-06-17 Thread Ian Lance Taylor
On Mon, Jun 17, 2024 at 7:49 PM Salvatore Domenick Desiano wrote: > > Here's a hopefully semantically identical minimal example: > > func main() { > > cmdName := "/bin/bash" > cmdArgs := []string{"-c", "sleep 5"} > cmdStdinR, cmdStdinW := io.Pipe() > cmdStdoutR, cmdStdoutW := io.Pipe() > go func()

Re: [go-nuts] Re: Breaking an io.Pipe loop

2024-06-17 Thread Salvatore Domenick Desiano
On Mon, Jun 17, 2024 at 11:39 PM Robert Engels wrote: > Nothing is writing and closing StdInR so it will never complete. > I may have this wrong, but isn't io.Copy writing to cmdStdinW and therefore to cmdStdinR? As for the closing... that's the point. I only want to close cmdStdinR in response

Re: [go-nuts] Re: Breaking an io.Pipe loop

2024-06-17 Thread Robert Engels
Nothing is writing and closing StdInR so it will never complete. On Jun 17, 2024, at 9:54 PM, Salvatore Domenick Desiano wrote:A bunch of typos. The last paragraph should have been:This program deadlocks after 5 seconds. The three deadlocked Go routines are the explicit go func() (stuck on io.Cop

[go-nuts] Re: Breaking an io.Pipe loop

2024-06-17 Thread Salvatore Domenick Desiano
A bunch of typos. The last paragraph should have been: This program deadlocks after 5 seconds. The three deadlocked Go routines are the explicit go func() (stuck on io.Copy() because cmdStdoutR never closes), exec.Command's internal Go routine copying data to stdin also (stuck on io.Copy() because

[go-nuts] Re: Breaking an io.Pipe loop

2024-06-17 Thread Salvatore Domenick Desiano
Here's a hopefully semantically identical minimal example: func main() { cmdName := "/bin/bash" cmdArgs := []string{"-c", "sleep 5"} cmdStdinR, cmdStdinW := io.Pipe() cmdStdoutR, cmdStdoutW := io.Pipe() go func() { defer cmdStdinW.Close() io.Copy(cmdStdinW, cmdStdoutR) }() cmd := exec.Command(

Re: [go-nuts] Breaking an io.Pipe loop

2024-06-17 Thread Robert Engels
Code?On Jun 17, 2024, at 9:46 PM, Salvatore Domenick Desiano wrote:I've got some code that is basically Expect-lite written in Go. I've got a deadlock and I'm hoping someone here can help me untangle it. I posted this yesterday but at the time I thought the Expect part of the code wasn't relevant

[go-nuts] Breaking an io.Pipe loop

2024-06-17 Thread Salvatore Domenick Desiano
I've got some code that is basically Expect -lite written in Go. I've got a deadlock and I'm hoping someone here can help me untangle it. I posted this yesterday but at the time I thought the Expect part of the code wasn't relevant and I left it out. I now

Re: [go-nuts] Fwd: cmd.Wait & io.Pipe & SIGKILL

2024-06-17 Thread Salvatore Domenick Desiano
There might be. Or I might be holding it wrong. I'm about to post another thread with a different angle on this. This thread was mis-framed. On Mon, Jun 17, 2024 at 1:16 PM Harri L wrote: > I’m wondering if there’s a specific reason you’re using io.Pipe instead > of the Cmd.StdoutPipe helper? Wh

Re: [go-nuts] go clean -h isn't helpful

2024-06-17 Thread Ian Lance Taylor
On Mon, Jun 17, 2024 at 5:28 PM will@gmail.com wrote: > > ❯ go clean -h > usage: go clean [clean flags] [build flags] [packages] > Run 'go help clean' for details. > > This just tells me to invoke another help command. > > The flags package has the opinion that command help should print the do

[go-nuts] go clean -h isn't helpful

2024-06-17 Thread will....@gmail.com
❯ go clean -h usage: go clean [clean flags] [build flags] [packages] Run 'go help clean' for details. This just tells me to invoke another help command. The flags package has the opinion that command help should print the doc for flags. Shouldn't we do that for go clean -h too? -- You received

[go-nuts] Multipar/related Request in golang

2024-06-17 Thread Afriyie Abraham Kwabena
Hi, AM trying to prepare a multipart/related message which involve JSON data n1n2Request.JsonData and a binary data binaryData to be sent in HTTP request, however, am having issue abou how to set the boundries in the function below. The server is logging "Failed to parse boundary. missing/inva

[go-nuts] cmd/go: build and list do not accept absolute path

2024-06-17 Thread 孟帅
### What version of Go are you using (`go version`)? $ go version go version go1.22.4 linux/arm64 ### Does this issue reproduce with the latest release? yes ### What operating system and processor architecture are you using (`go env`)? go env Output $ go env GO111MODULE='auto' GOARCH='arm6

Re: [go-nuts] Fwd: cmd.Wait & io.Pipe & SIGKILL

2024-06-17 Thread Harri L
I’m wondering if there’s a specific reason you’re using io.Pipe instead of the Cmd.StdoutPipe helper? When using io.Pipe you need to Close the pipe by yourself, but when using the Cmd.StdoutPipe, the Cmd.Wait will close the pipe for you. Here’s a sample following your previous example: func m

Re: [go-nuts] strip / reduce module compile size

2024-06-17 Thread Tony M
Are there other tools that may show the final size? I'd like to see if there are more aggressive flags to strip unused code? It's a simple module, with some grpc (protobuf), http . I don't believe all these code paths are in scope for my 200 LOC On Friday, June 14, 2024 at 6:20:37 PM UTC-7 Dan

Re: [go-nuts] Re: coroutine size

2024-06-17 Thread cheng dong
stackless coroutine could not be replace by a method call chain, it might have loop and branch etc. On Sunday, June 16, 2024 at 12:08:27 PM UTC+8 Robert Engels wrote: > I don’t think that is possible. You can have stackless coroutines, but if > a coroutine has no state at all it would simply be

Re: [go-nuts] Re: strip / reduce module compile size

2024-06-17 Thread Peter Galbavy
These were my original worries, but as a human CLI user I notice no start-up time impact; I am certain if you benchmark it then there will be a small delay, but it's well under the human perception limit. Runtime performance, ditto. As always, YMMV and do your own due diligence! On Saturday 15