Re: [go-nuts] Type Parameters Proposal, few unimportant questions

2021-09-23 Thread Brian Candler
On Thursday, 23 September 2021 at 18:07:19 UTC+1 kziem...@gmail.com wrote: > Understand this whole text without running code in compiler is just above > my mediocre (at best) programming skills. Compilers errors are one of mine > favorite teachers. You can try out examples online in the go2 pl

Re: [go-nuts] How to check whether a variable is unreachable?

2021-09-23 Thread Cholerae Hu
I get it. Thanks for all your responses! 在2021年9月23日星期四 UTC+8 下午8:36:11 写道: > > Package runtime > https://pkg.go.dev/runtime > > Documentation > > func KeepAlive > > > Note: KeepAlive should only be used to prevent final

Re: [go-nuts] gollvm for LLVM13

2021-09-23 Thread Khanh TN
Hi, Than Thanks a lot! It is working now. go version is "unknown" but it is okay. Khanh On Thursday, September 23, 2021 at 3:30:35 AM UTC+8 Khanh TN wrote: > I will try that. > Thanks for your support! > Khanh > > > On Wednesday, September 22, 2021 at 10:21:41 PM UTC+8 th...@google.com > wrote: >

Re: [go-nuts] What is the total max size of embed content?

2021-09-23 Thread Glen Newton
Oh, regarding the comments about breaking tool chains: valgrind fails on this binary: $ valgrind --version valgrind-3.16.1 $ valgrind ./goembeddb -S -q valgrind: mmap(0x54e000, 1977884672) failed in UME with error 22 (Invalid argument). valgrind: this can be caused by executables with very large

Re: [go-nuts] What is the total max size of embed content?

2021-09-23 Thread Glen Newton
I have a MWE here: https://github.com/gnewton/goembeddb TLDR: a MWE embedding a key-value store file of 20 million k/v pairs (1.9GB) into a Go binary and using the db from the binary. The same Go program that writes the db then is recompiled, embedding the db in the newly compiled Go binary. Si

Re: [go-nuts] Parse JSON case-sensitively

2021-09-23 Thread Tyler Compton
Hi Aaron, I'm not aware of a JSON library that fits your needs, but there might be an XY Problem going on here. What problem are you having trouble solving with encoding/json that lead you to this solution? On Thu, Sep 23, 2021 at 11:23 AM 'Aaron' via golang-nuts < golan

[go-nuts] Re: Idea extending xerror.As

2021-09-23 Thread Haddock
Brian Candler schrieb am Sonntag, 19. September 2021 um 20:46:45 UTC+2: > > I'm not sure how useful that is though, especially because "return" inside > that anonymous function will return from that anonymous function, not the > outer function. > https://go2goplay.golang.org/p/h6ZRnqM5cRx > Y

[go-nuts] Re: Go Unit Test Crashes with logrus

2021-09-23 Thread Sean Liao
update your version of golang.org/x/sys On Thursday, September 23, 2021 at 8:23:45 PM UTC+2 Yoram Forscher wrote: > I have a problem running Go unit tests on my laptop. When I run the test > it crashes with SIGSEGV inside logrus. If I set the logging level to a high > level (e.g., FatalLevel),

[go-nuts] Parse JSON case-sensitively

2021-09-23 Thread 'Aaron' via golang-nuts
Hi all Anyone know of a JSON package (or other solution) which is case-sensitive when decoding - and is also mature, simple, and parses into a struct? I've looked at a few open-source packages, but the ones I've found seem to be focused on performance, or allowing you to access the JSON in diffe

[go-nuts] Go Unit Test Crashes with logrus

2021-09-23 Thread Yoram Forscher
I have a problem running Go unit tests on my laptop. When I run the test it crashes with SIGSEGV inside logrus. If I set the logging level to a high level (e.g., FatalLevel), disabling actual logging, it does not crash. I tried to delete and download logrus again to no avail. I'm running with

[go-nuts] [ANN] pion/webrtc v3.1.0 is released - Pure Go implemenation of WebRTC

2021-09-23 Thread Sean DuBois
https://github.com/pion/webrtc/releases/tag/v3.1.0 This is a project I have been working on for a couple years and finally got a new release out. Would love to chat/answer questions here about Pion or even just WebRTC in general! I am always trying to make WebRTC easier/more accessible. So if

Re: [go-nuts] Type Parameters Proposal, few unimportant questions

2021-09-23 Thread Kamil Ziemian
Hello, I finish reading this proposal (https://go.googlesource.com/proposal/+/refs/heads/master/design/43651-type-parameters.md). It is hard to judge how much I understand of it probably between 40% and 70%, so I apologize if I make some stupid comment below, because I just miss something. Un

Re: [go-nuts] How to check whether a variable is unreachable?

2021-09-23 Thread peterGo
Package runtime https://pkg.go.dev/runtime Documentation func KeepAlive Note: KeepAlive should only be used to prevent finalizers from running prematurely. Peter On Thursday, September 23, 2021 at 2:23:47 AM UTC-4 c

Re: [go-nuts] How to check whether a variable is unreachable?

2021-09-23 Thread peterGo
$ go vet ch.go # command-line-arguments ./ch.go:19:28: possible misuse of unsafe.Pointer $ https://play.golang.org/p/n9A_sR1yuXC Peter On Thursday, September 23, 2021 at 2:23:47 AM UTC-4 chole...@gmail.com wrote: > Thanks, I see. How about this one? I use a temp variable to store sh.Data, >

Re: [go-nuts] How to check whether a variable is unreachable?

2021-09-23 Thread jake...@gmail.com
I'm pretty sure new example is not valid Go code to begin with. You violate the rules on converting from uintptr to unsafe.Pointer. If you read the rules at https://pkg.go.dev/unsafe#Pointer, a unitptr can not *generally *be converted to an unsafe.Pointer. Since this code is not valid, the quest

[go-nuts] Re: Unable to handle duplicate cookies

2021-09-23 Thread christoph...@gmail.com
Thank you very much. This solves my issue. Le jeudi 23 septembre 2021 à 10:42:35 UTC+2, seank...@gmail.com a écrit : > net/http.Request.Cookie is a convenience function documented to return a > single cookie > net/http.Request.Cookies will return all cookies, filtering on that should > be prett

[go-nuts] Re: Unable to handle duplicate cookies

2021-09-23 Thread Sean Liao
net/http.Request.Cookie is a convenience function documented to return a single cookie net/http.Request.Cookies will return all cookies, filtering on that should be pretty easy On Thursday, September 23, 2021 at 10:02:34 AM UTC+2 christoph...@gmail.com wrote: > I implemented a simple web site

[go-nuts] Unable to handle duplicate cookies

2021-09-23 Thread christoph...@gmail.com
I implemented a simple web site with a csrf secure cookie that is reset for each page showing a form. I assumed that simply setting the cookie with the same name and a new value would override the cookie in the client browser. This assumption is correct as long as the url of the page is the sam