Re: [go-nuts] Nil could be the zero value for type variables

2022-06-10 Thread Will Faught
Thanks. I think these are more complicated and less consistent, since they require adding syntax for `_`, but I can see a similar motivation. On Sun, Jun 5, 2022 at 9:44 PM Nigel Tao wrote: > On Tue, May 31, 2022 at 1:39 AM Will Faught wrote: > >> Why not allow nil to be used as the zero value

Re: [go-nuts] Elementary Question About Calling Functions in Different Packages

2022-06-10 Thread jlfo...@berkeley.edu
On Friday, June 10, 2022 at 6:48:58 PM UTC-7 ben...@gmail.com wrote: > > I agree it might be painful, and might lead to non-idiomatic Go! But it > sounds like a really good challenge, and will no doubt teach you a lot > along the way. It looks like you've already learned something from this >

Re: [go-nuts] Elementary Question About Calling Functions in Different Packages

2022-06-10 Thread ben...@gmail.com
Kurtis has given some great answers about the general problem. I do have a bit of a counterpoint to this statement, however: > > As a learning exercise I'm converting a large app into Go. > > That's going to be a painful way to learn Go. Worse, doing a straightforward, mechanical, translation o

[go-nuts] Go 1.19 Beta 1 is released

2022-06-10 Thread announce
Hello gophers, We have just released go1.19beta1, a beta version of Go 1.19. It is cut from the master branch at the revision tagged go1.19beta1. Please try your production load tests and unit tests with the new version. Your help testing these pre-release versions is invaluable. Report any prob

Re: [go-nuts] encoding/asn1 overly strict?

2022-06-10 Thread Brian Candler
On Friday, 10 June 2022 at 14:31:10 UTC+1 Andreas Götz wrote: > On Thursday, June 9, 2022 at 6:44:58 PM UTC+2 Brian Candler wrote: > >> I forgot to add one thing, and you didn't paste the whole certificate PEM >> so I can't check this. >> >> Recent versions of Go won't verify the certificate unle

[go-nuts] Re: Ignore stale read errors from the race detector

2022-06-10 Thread Jeff Learman
Consider skipping specific tests when the race detector is active. Alternatively (and dangerously, unless you understand the consequences), provide two implementations; one that is safe and is used when race detection is enabled, and another that is unsafe, and use build flags to control it:

Re: [go-nuts] Re: Ignore stale read errors from the race detector

2022-06-10 Thread Jeff Learman
Unlike C, Go has no `volatile` keyword. Therefore, the compiler is allowed to cache a value that is never updated in the scope that it sees, and there's no way for us to tell it not to do that. Issues like this aren't really data races, but they are caught by the race detector. On Wednesday,

Re: [go-nuts] encoding/asn1 overly strict?

2022-06-10 Thread Andreas Götz
On Thursday, June 9, 2022 at 6:44:58 PM UTC+2 Brian Candler wrote: > I forgot to add one thing, and you didn't paste the whole certificate PEM > so I can't check this. > > Recent versions of Go won't verify the certificate unless it contains a > subjectAltName; matching against only the CN is no

Re: [go-nuts] Elementary Question About Calling Functions in Different Packages

2022-06-10 Thread jake...@gmail.com
> > So, I'll probably have to keep using multiple packages if I can somehow > figure out how to solve > the package import cycle problem. > The most common solution is to factor out the aspects which cause the cycle > into a third package that one or both of the current packages imports. In >

Re: [go-nuts] unrecognized import path "code.google.com/p/go.crypto/openpgp"

2022-06-10 Thread 'Sean Liao' via golang-nuts
Note that x/crypto/openpgp has been frozen and deprecated, you're better off with a third party maintained package - sean On Fri, Jun 10, 2022, 00:41 'Dan Kortschak' via golang-nuts < golang-nuts@googlegroups.com> wrote: > On Thu, 2022-06-09 at 14:21 -0700, Peter Sjolin wrote: > > I attempted to