[go-nuts] Re: How to capture the bytes of stdin

2021-08-18 Thread Tamás Gulácsi
You have to io.Copy(cmdStdin, os.Stdin) to use your program's stdin, and pipe it to the subprocess. hyo...@gmail.com a következőt írta (2021. augusztus 18., szerda, 17:50:24 UTC+2): > The goal: I want to capture all the bytes of *cmd.Stdin* and process them > with this rot13 function:

[go-nuts] Re: Small number change will affect benchmark results

2021-08-18 Thread tapi...@gmail.com
The PR: https://github.com/golang/go/pull/47804 On Wednesday, August 18, 2021 at 11:35:05 PM UTC-4 tapi...@gmail.com wrote: > More specifically, the last parameter (needzero) of mallocgc is not passed > down to c.nextFree, which causes the memclrNoHeapPointers function is > called twice in

[go-nuts] Re: Small number change will affect benchmark results

2021-08-18 Thread tapi...@gmail.com
More specifically, the last parameter (needzero) of mallocgc is not passed down to c.nextFree, which causes the memclrNoHeapPointers function is called twice in makeslicecopy if the slice size <= 32768. On Wednesday, August 18, 2021 at 11:06:53 PM UTC-4 tapi...@gmail.com wrote: > Spent some

[go-nuts] Re: Small number change will affect benchmark results

2021-08-18 Thread tapi...@gmail.com
Spent some time on investigating this problem. It is confirmed that, when N == 16384, the memclrNoHeapPointers function is called twice in the Insert2 function. That means the "make+copy` optimization introduced in Go 1.15 will perform worse than the normal route under such situation. On

Re: [go-nuts] Leading dash invalid in test filename inside module

2021-08-18 Thread Ben Hoyt
Awesome, thanks. At a previous company, we used to take months/years to upgrade to a new Go version, so it's nice that you guys are eating your own dog food so quickly. :-) For now, I've removed the leading-dash test file and released a new patch version. When I reinstate it I may end up putting

Re: [go-nuts] Leading dash invalid in test filename inside module

2021-08-18 Thread 'Jay Conrod' via golang-nuts
You're exactly right, the proxy is still in the process of migrating to Go 1.17. It should be done in the next day or two, at which point it should be able to fetch this version. In the mean time, you can work around it by setting GOPRIVATE= github.com/benhoyt/goawk

[go-nuts] Leading dash invalid in test filename inside module

2021-08-18 Thread Ben Hoyt
(I wasn't quite sure whether golang-nuts or golang-dev was the best place for this -- sending to golang-nuts for now.) I just released a new version of GoAWK (v1.8.0) using Go version 1.17, and then tested installing it using "go install". However, go install complains with the following: $ go

Re: [go-nuts] Various questions about posts from The Go Blog

2021-08-18 Thread Ian Lance Taylor
On Wed, Aug 18, 2021 at 1:30 AM Kamil Ziemian wrote: > > I guess it should say "any number type", but I'm not 100% sure. Am I right? > > Thank you for the answer. I'm not good at computer science, so I'm often > can't decide is this mistake or is there some subtlety that I'm missing. Thanks for

[go-nuts] Re: how golang stores variables in the computer’s memory?

2021-08-18 Thread jake...@gmail.com
It will also help you look knowledgeable if you refer to the language as Go, never `golang`. The name of the language is just 'Go'. In my experience the term golang should only be used when you need to clarify for a search engine. I don't usually bother correct people on this issue, but given

[go-nuts] proxying plaintext requests over HTTP Connect

2021-08-18 Thread Rudy Dai
I have an HTTP Proxy configured that only accepts HTTP CONNECT requests to proxy requests to upstream servers, with some upstream servers using HTTPS and some using HTTP. However, the behavior in https://golang.org/src/net/http/transport.go around line 1638 makes it so that HTTP CONNECT

Re: [go-nuts] Re: Why do I get multiple times the same data?

2021-08-18 Thread hyogy hyogy
Thanks!(: Resetting the buffer was the solution! May I ask another tip please? Il giorno venerdì 30 luglio 2021 alle 19:03:41 UTC+2 Vadim Berezniker ha scritto: > fub is declared outside the for loop and io.Copy(, ) will append to > the buffer. > > On Thu, Jul 29, 2021 at 11:41 AM hyogy

[go-nuts] How to capture the bytes of stdin

2021-08-18 Thread hyogy hyogy
The goal: I want to capture all the bytes of *cmd.Stdin* and process them with this rot13 function: https://play.golang.org/p/VX2pwaIqhmT The story: I'm coding a small tool which will be cross compiled for both win/ linux, so I'm trying to make it as simple as possible. This tool connects to

[go-nuts] Re: New to Unit Testing - Testing HTTP requests and response codes

2021-08-18 Thread Maxime Soulé
Hi, You can have a look at tdhttp [1] included in go-testdeep [2] module. ++ Max. 1. https://pkg.go.dev/github.com/maxatome/go-testdeep/helpers/tdhttp#hdr-TestAPI 2. https://go-testdeep.zetta.rocks/ Le mardi 17 août 2021 à 22:14:44 UTC+2, Beginner a écrit : > Hey, so I am pretty new to

[go-nuts] Re: Go 1.17 is released

2021-08-18 Thread jfcg...@gmail.com
Hi, I benchmarked sorty v1.0.18 on an old laptop with Core i5-4210M CPU & Manjaro Linux, between Go 1.16.7 and 1.17 (o for optimization flags, in seconds): *16**16o* *17**17o* Sorting uint32 sort.Slice|17.25|16.03|14.95|14.00 sorty-1|

Re: [go-nuts] Re: Why do I get multiple times the same data?

2021-08-18 Thread LetGo
Resetting the buffer was the right solution! Thanks(:! May I ask another tip please? Il giorno venerdì 30 luglio 2021 alle 19:03:41 UTC+2 Vadim Berezniker ha scritto: > fub is declared outside the for loop and io.Copy(, ) will append to > the buffer. > > On Thu, Jul 29, 2021 at 11:41 AM

Re: [go-nuts] Various questions about posts from The Go Blog

2021-08-18 Thread Kamil Ziemian
I guess it should say "any number type", but I'm not 100% sure. Am I right? Thank you for the answer. I'm not good at computer science, so I'm often can't decide is this mistake or is there some subtlety that I'm missing. Small mistake and typos are quite common in blogs and talks and I am

[go-nuts] A question about metric `/sched/latencies:seconds` in go1.17's package runtime/metrics

2021-08-18 Thread rmfr
Hi, I am reading the description of metric `/sched/latencies:seconds` in runtime/metrics: ``` /sched/latencies:seconds Distribution of the time goroutines have spent in the scheduler in a runnable state before actually running. ``` I wonder such records are from all the goroutines'

[go-nuts] [ANN] Olric v0.4.0 is out. Distributed cache and in-memory key/value data store. It can be used both as an embedded Go library and as a language-independent service.

2021-08-18 Thread Burak Sezer
*What is Olric?* Distributed cache and in-memory key/value data store. It can be used both as an embedded Go library and as a language-independent service. With Olric, you can instantly create a fast, scalable, shared pool of RAM across a cluster of computers. See the repository on GitHub to