Re: [go-nuts] Why fmt.Println(math.Sqrt2) gives ...0951 not ...0950?

2021-04-30 Thread Ian Lance Taylor
On Fri, Apr 30, 2021 at 5:31 PM Kamil Ziemian wrote: > > Wikipedia says that sqrt(2) = 1.414213562373095048..., so I would round it to > ...0950, while fmt.Println(math.Sqrt2) give me ...0951. > https://en.wikipedia.org/wiki/Square_root_of_2 > > According to https://golang.org/pkg/math/#pkg-const

[go-nuts] Why fmt.Println(math.Sqrt2) gives ...0951 not ...0950?

2021-04-30 Thread Kamil Ziemian
Hello. Wikipedia says that sqrt(2) = 1.414213562373095048..., so I would round it to ...0950, while fmt.Println(math.Sqrt2) give me ...0951. https://en.wikipedia.org/wiki/Square_root_of_2 According to https://golang.org/pkg/math/#pkg-constants Sqrt2 is defined with far more digits, so rounding

[go-nuts] Accidentally released a v1.0.0 for my package, how do I go back from there here?

2021-04-30 Thread Astha Jain
Hello, I accidentally created a release v1.0.0 for my public package, and it is not cached in module cache. I deleted the release from git and created a new 0.x release for the package. but when I do go get ..@latest, I still get 1.0.0 version. How do I go back? -- You received this message

Re: [go-nuts] How string constants are propagated inside a small func

2021-04-30 Thread Ian Lance Taylor
On Fri, Apr 30, 2021 at 10:51 AM 'Valentin Deleplace' via golang-nuts wrote: > > Hi, I was surprised that the funcs f and g do not generate the same assembly > code: > > func f() string { > s := "a" + "b" > return s > } > > func g() string { > s := "a" > s += "b" >

Re: [go-nuts] How string constants are propagated inside a small func

2021-04-30 Thread Jan Mercl
On Fri, Apr 30, 2021 at 7:51 PM 'Valentin Deleplace' via golang-nuts wrote: > func f() string { > s := "a" + "b" > return s > } Handled by constant folding. > func g() string { > s := "a" > s += "b" > return s > } The second assignment to 's' here is not

[go-nuts] How string constants are propagated inside a small func

2021-04-30 Thread 'Valentin Deleplace' via golang-nuts
Hi, I was surprised that the funcs f and g do not generate the same assembly code: func f() string { s := "a" + "b" return s } func g() string { s := "a" s += "b" return s } The compiled assembly respects the apparent instructions of the source code, wit

Re: [go-nuts] fatal error: out of memory allocating heap arena map.

2021-04-30 Thread Ian Lance Taylor
On Fri, Apr 30, 2021 at 9:25 AM Raja Murugan wrote: > > fatal error: out of memory allocating heap arena mapruntime stack: > runtime.throw(0xb580a0, 0x27) /usr/lib/golang/src/runtime/panic.go:1116 +0x72 > fp=0x7ffde7fd3380 sp=0x7ffde7fd3350 pc=0x436132 > runtime.(*mheap).sysAlloc(0xfef4a0, 0x40

Re: [go-nuts] how to delete source file path informatin in panic‘s stack trace

2021-04-30 Thread Ian Lance Taylor
On Fri, Apr 30, 2021 at 9:25 AM Yandong Zhang wrote: > > It seems that this is still a quite annoying issue. The ldflags -s -w did not > work at all for this purpose. > Would anyone recommend a way to remove or hide the file path resulted from > the panic? See the "go build" -trimpath option.

[go-nuts] Re: fatal error: out of memory allocating heap arena map.

2021-04-30 Thread Raja Murugan
attached stacktrace On Friday, 30 April 2021 at 21:55:37 UTC+5:30 Raja Murugan wrote: > fatal error: out of memory allocating heap arena mapruntime stack: > runtime.throw(0xb580a0, 0x27) /usr/lib/golang/src/runtime/panic.go:1116 > +0x72 fp=0x7ffde7fd3380 sp=0x7ffde7fd3350 pc=0x436132 > runtim

[go-nuts] fatal error: out of memory allocating heap arena map.

2021-04-30 Thread Raja Murugan
fatal error: out of memory allocating heap arena mapruntime stack: runtime.throw(0xb580a0, 0x27) /usr/lib/golang/src/runtime/panic.go:1116 +0x72 fp=0x7ffde7fd3380 sp=0x7ffde7fd3350 pc=0x436132 runtime.(*mheap).sysAlloc(0xfef4a0, 0x40, 0x0, 0x4) /usr/lib/golang/src/runtime/malloc.go:737 +0x7

Re: [go-nuts] how to delete source file path informatin in panic‘s stack trace

2021-04-30 Thread Yandong Zhang
Hello Gents, It seems that this is still a quite annoying issue. The ldflags -s -w did not work at all for this purpose. Would anyone recommend a way to remove or hide the file path resulted from the panic? Thank you! On Friday, November 22, 2013 at 6:16:51 AM UTC-6 flhs...@gmail.com wrote: >

[go-nuts] New advanced, CGo-free SQLite package

2021-04-30 Thread Ross Light
I've created a new Go package for SQLite: zombiezen.com/go/sqlite It is a fork of crawshaw.io/sqlite that uses modernc.org/sqlite , a CGo-free SQLite package. It aims to be a most

Re: [go-nuts] Still "missing" priority or ordered select in go?

2021-04-30 Thread 'Axel Wagner' via golang-nuts
On Fri, Apr 30, 2021 at 9:53 AM Øyvind Teig wrote: > If there is no notion of simultaneity why all the effort to describe the > random distribution? > While it's not possible for two cases to become ready at the same time, it's definitely possible for two cases to be ready when entering a select

Re: [go-nuts] HTTP request reading

2021-04-30 Thread Amit Saha
> On 29 Apr 2021, at 11:27 pm, K. Alex Mills wrote: > > Partial responses inline, HTH. > > On Thu, Apr 29, 2021, 6:09 AM Amit Saha > wrote: > Hi all, when an incoming request comes in, does the ListenAndServe() > function read the first line (as explained in > ht

Re: [go-nuts] Still "missing" priority or ordered select in go?

2021-04-30 Thread Øyvind Teig
fredag 30. april 2021 kl. 02:45:02 UTC+2 skrev Ian Lance Taylor: > On Thu, Apr 29, 2021 at 12:05 PM Øyvind Teig > wrote: > > > > The example here is a server with N clients where it is essential that > none of clients will starve and none jam the server. I have needed to do > this coding s

Re: [go-nuts] Still "missing" priority or ordered select in go?

2021-04-30 Thread Øyvind Teig
torsdag 29. april 2021 kl. 23:52:05 UTC+2 skrev rog: > On Thu, 29 Apr 2021, 20:05 Øyvind Teig, wrote: > >> torsdag 29. april 2021 kl. 20:22:32 UTC+2 skrev rog: >> >>> I agree with Axel's take here. It seems, Øyvind, that you are concerned >>> more with principle than practice here. Can you giv