Re: [go-nuts] [generics]: Pointer methods in interfaces used as constraints?

2020-08-15 Thread Ian Lance Taylor
On Fri, Aug 14, 2020 at 9:31 PM Patrick Smith wrote: > > https://go.googlesource.com/proposal/+/refs/heads/master/design/go2draft-type-parameters.md#pointer-method-example > has this example: > > // Setter2 is a type constraint that requires that the type > // implement a Set method that sets

Re: [go-nuts] New linker

2020-08-15 Thread Ian Lance Taylor
On Sat, Aug 15, 2020 at 11:49 AM Amnon wrote: > > What is the best place to read about the ongoing work on the new linker? > With the Go 1.15 release, how far along are we with the plans? > What has been achieved? > And what is still to come? The work on the new linker is close to complete and

Re: [go-nuts] obtaining the original type from a named alias type with go/types?

2020-08-15 Thread Ian Lance Taylor
On Sat, Aug 15, 2020 at 3:45 PM 'Dan Kortschak' via golang-nuts wrote: > > I would like to be able to obtain the original type for an alias given > a source input. I can see in "go/types" that it's possible to know > whether a named type is an alias by `typ.Obj().IsAlias()`, but I cannot > see

Re: [go-nuts] Re: module confusion

2020-08-15 Thread Marvin Renich
* fge...@gmail.com [200815 03:44]: > On 8/15/20, Marvin Renich wrote: > > * Volker Dobler [200814 14:53]: > >> On Friday, 14 August 2020 20:39:37 UTC+2, K Richard Pixley wrote: > >> > Isn't this the default location? I just untarred the distribution... > >> > >> No. There is a reason

[go-nuts] Re: which pass of SSA will transform a ssa.Value(op=OpPhi) phi operations to a normal(not phi operations)?

2020-08-15 Thread Keith Randall
The regalloc pass does that. It ensures that all the inputs and the output of a phi are all in the same register (or memory location), so the phi becomes a no-op. The regalloc pass doesn't actually remove the phi, though. Removal is actually in genssa in cmd/compile/internal/gc/ssa.go. Look for

[go-nuts] obtaining the original type from a named alias type with go/types?

2020-08-15 Thread 'Dan Kortschak' via golang-nuts
I would like to be able to obtain the original type for an alias given a source input. I can see in "go/types" that it's possible to know whether a named type is an alias by `typ.Obj().IsAlias()`, but I cannot see how to obtain the actual original type unless it is an alias for a basic type. Can

[go-nuts] New linker

2020-08-15 Thread Amnon
What is the best place to read about the ongoing work on the new linker? With the Go 1.15 release, how far along are we with the plans? What has been achieved? And what is still to come? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

[go-nuts] Re: Windows 'Access is denied' for os.Remove after exec.Output()

2020-08-15 Thread Bob Alexander
Here's what I think is really going on: At the end of a process's execution, 2 things happen: - The process's code finishes its execution -- wait returns. - The OS closes the executable file. The second item always "comes after" the first. On Windows the delay might be a few milliseconds,

Re: [go-nuts] The latest version of package in pkg.go.dev

2020-08-15 Thread Shulhan
> On 15 Aug 2020, at 22.50, Tong Sun wrote: > > Oh, thanks. > > The very reason that I do that is to avoid the following situation: > > for i in `jot 12`; do echo $i > f; git commit -am "$i"; git tag v0.0.$i; done > > $ git tag -l > v0.0.1 > v0.0.10 > v0.0.11 > v0.0.12 > v0.0.2 > v0.0.3 >

AW: [go-nuts] Re: The latest version of package in pkg.go.dev

2020-08-15 Thread Lutz Horn
Take a look at this: https://gist.github.com/loisaidasam/b1e6879f3deb495c22cc Von: Tong Sun Gesendet: ‎15.‎08.‎2020 17:51 An: golang-nuts Cc: seank...@gmail.com Betreff:

Re: [go-nuts] map without default values

2020-08-15 Thread jake...@gmail.com
On Friday, August 14, 2020 at 2:52:20 PM UTC-4 Joe Marty wrote: > >> If I know that a value exists, or am fine using the zero value (again, >> that's the majority of my personal use-cases for maps at least), having to >> use a statement just to discard the extra bool is annoying. >> > >

Re: [go-nuts] Re: The latest version of package in pkg.go.dev

2020-08-15 Thread Tong Sun
Oh, thanks. The very reason that I do that is to avoid the following situation: for i in `jot 12`; do echo $i > f; git commit -am "$i"; git tag v0.0.$i; done $ git tag -l v0.0.1 v0.0.10 v0.0.11 v0.0.12 v0.0.2 v0.0.3 v0.0.4 v0.0.5 v0.0.6 v0.0.7 v0.0.8 v0.0.9 If no leading 0s allowed, how do you

[go-nuts] which pass of SSA will transform a ssa.Value(op=OpPhi) phi operations to a normal(not phi operations)?

2020-08-15 Thread xie cui
as we know, SSA has phi function, but the output of go tool compile -S xxx.go which do not contains a phi instruction. so i am trying to find out which SSA pass will transform a phi Op ssa.Value to normal ops? -- You received this message because you are subscribed to the Google Groups

Re: [go-nuts] Generics: after type lists

2020-08-15 Thread roger peppe
On Sat, 15 Aug 2020 at 04:57, Patrick Smith wrote: > On Thu, Aug 13, 2020 at 11:25 PM Patrick Smith > wrote: > > I tried out a few different implementations, evaluating the polynomial > > instead of finding roots, > > at https://go2goplay.golang.org/p/g8bPHdg5iMd . As far as I can tell, > >

[go-nuts] Re: The latest version of package in pkg.go.dev

2020-08-15 Thread seank...@gmail.com
that's an invalid semver, no leading 0s allowed https://semver.org/#spec-item-2 : A normal version number MUST take the form X.Y.Z where X, Y, and Z are non-negative integers, and MUST NOT contain leading zeroes. X is the major version, Y is the minor version, and Z is the patch version. Each

Re: [go-nuts] Re: module confusion

2020-08-15 Thread fgergo
On 8/15/20, Marvin Renich wrote: > * Volker Dobler [200814 14:53]: >> On Friday, 14 August 2020 20:39:37 UTC+2, K Richard Pixley wrote: >> > Isn't this the default location? I just untarred the distribution... >> >> No. There is a reason https://golang.org/doc/install#install >> states to do