Re: [go-nuts] [ generics] Moving forward with the generics design draft

2020-08-21 Thread 'Carla Pfaff' via golang-nuts
On Friday, 21 August 2020 at 16:46:22 UTC+2 bbse...@gmail.com wrote: > All constraints except "any" specify a constraint for the type. A > Stringer constraint will ensure that the type has String() string > method. "any" is a lack of constraint. The empty interface / any is a constraint that

Re: [go-nuts] [ generics] Moving forward with the generics design draft

2020-08-21 Thread 'Carla Pfaff' via golang-nuts
On Friday, 21 August 2020 at 14:57:13 UTC+2 bbse...@gmail.com wrote: > interface{}, when used as a constraint, doesn't mean than the value > has to be an interface{}, it means the value can be anything. > interface{}, when used as a value, doesn't mean that the value can be > anything, it

[go-nuts] Re: module confusion

2020-08-14 Thread 'Carla Pfaff' via golang-nuts
This has nothing to do with modules. You're still using the old GOPATH mode, because you're not in a directory with a go.mod file. GOPATH defaults to $HOME/go when it's not set (since 1.8), but that's where you chose to put your Go installation. This is not allowed. Either install Go to a

Re: [go-nuts] Re: module confusion

2020-08-14 Thread 'Carla Pfaff' via golang-nuts
People and installers usually install Go in /usr/local/go on Unix-like systems. ~/go is the default GOPATH if not set, so ~/go/bin is where binaries installed via "go get" / "go install" land. But the Go distribution itself must not be under GOPATH. -- You received this message because you

[go-nuts] Re: Generics and parentheses

2020-07-15 Thread 'Carla Pfaff' via golang-nuts
I really like this square bracket syntax and I'm glad that Go does not repeat the mistakes other languages have made.. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an

[go-nuts] Re: Why we don't have simple throws error statement

2020-08-01 Thread 'Carla Pfaff' via golang-nuts
Your "throws" statement (why is it called "throws" when it "catches" according to the comment?) looks a lot like the "handle" block from the first draft design by the Go team: the check/handle proposal . On

Re: [go-nuts] A few thoughts on type parameters

2020-08-03 Thread 'Carla Pfaff' via golang-nuts
On Monday, 3 August 2020 at 19:46:05 UTC+2 Ian Lance Taylor wrote: > Yet another possibility, going back to the syntax question above, is > requiring that a type parameter for a type alway have a constraint, > which would mean that we would never use the "type" keyword for type > parameters,

Re: [go-nuts] A few thoughts on type parameters

2020-08-03 Thread 'Carla Pfaff' via golang-nuts
On Tuesday, 4 August 2020 at 00:34:12 UTC+2 ben...@gmail.com wrote: > Which at first seems like a good idea, but then unless "any" is built in > or this becomes a well-known idiom, it won't be as self-documenting. Other > people will have to look up the definition to see "oh, I see, this is

[go-nuts] Re: Modifying Source code and build go from the source.

2020-08-07 Thread 'Carla Pfaff' via golang-nuts
Well, it says "lock_futex.go:152:2: ns declared but not used". An unused variable is a compile error in Go. On Friday, 7 August 2020 at 09:54:23 UTC+2 Yosef Yo wrote: > /home/nn/Downloads/go/src/runtime/lock_futex.go:152:2: ns declared but not > used > > go tool dist: FAILED > -- You

Re: [go-nuts] [proposal] Make go compiler work with different syntax versions in same project to support adaptivity

2020-08-10 Thread 'Carla Pfaff' via golang-nuts
On Monday, 10 August 2020 at 10:30:55 UTC+2 Ivan Ivanyuk wrote: > There is already an instrument in playground that works fine. Why not just > roll it out and improve design, if needed, in next version? > The go2go tool is just a toy, an experiment, a simple translation tool. It will be thrown

[go-nuts] Re: [generics] How to use maps in generic structs?

2020-08-10 Thread 'Carla Pfaff' via golang-nuts
K and V must be comparable, since you use them as map keys: type BiMap[type V, K comparable] struct { forward map[K]V reverse map[V]K } -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails

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

2020-08-07 Thread 'Carla Pfaff' via golang-nuts
On Saturday, 8 August 2020 at 01:33:59 UTC+2 Patrick Smith wrote: > if we think it likely that a future version of Go will allow operator > overloading > That's highly unlikely: https://golang.org/doc/faq#overloading -- You received this message because you are subscribed to the Google

[go-nuts] Re: go.pkg.dev: blitznote.com/src/semver doesn't show up

2020-06-26 Thread 'Carla Pfaff' via golang-nuts
For me it is in the search results. Currently on page 5, fifth entry: https://pkg.go.dev/search?page=5=semver On Friday, 26 June 2020 at 21:47:30 UTC+2 Mark Kubacki wrote: > Hi, > > I've noticed my package, blitznote.com/src/semver, doesn't show up in > pkg.go.dev despite having been licensed

[go-nuts] [generics] Feedback on optional type keyword experiment

2020-07-25 Thread 'Carla Pfaff' via golang-nuts
I just discovered the experiment to make the "type" keyword optional in certain cases on the dev.go2go branch. The commit message says: --- Experiment: Make "type" keyword optional in generic type declarations when it is clear that we can't have an array type declaration. This is the

[go-nuts] Re: [generics] Feedback on optional type keyword experiment

2020-07-25 Thread 'Carla Pfaff' via golang-nuts
To expand on my post: It would be very consistent with the structure of regular parameter lists. Just like every parameter in a regular parameter list must have a type (with the exception of multiple consecutive parameters having the same type), every type parameter in a type parameter list

Re: [go-nuts] Re: [generics] Feedback on optional type keyword experiment

2020-07-25 Thread 'Carla Pfaff' via golang-nuts
QV5LTAIuDr > > On Saturday, 25 July 2020 at 22:22:24 UTC+2 Ian Lance Taylor wrote: > >> On Sat, Jul 25, 2020 at 11:47 AM 'Carla Pfaff' via golang-nuts >> wrote: >> > >> > To expand on my post: >> > It would be very consistent with the struc

Re: [go-nuts] Re: [generics] Feedback on optional type keyword experiment

2020-07-25 Thread 'Carla Pfaff' via golang-nuts
On Saturday, 25 July 2020 at 22:22:24 UTC+2 Ian Lance Taylor wrote: > Note that in this way constraints on type parameters are different > from types of regular parameters. It makes no sense to speak of a > regular parameter with no type. > In regular parameter lists interface{} has this role,

Re: [go-nuts] Re: [generics] Feedback on optional type keyword experiment

2020-07-25 Thread 'Carla Pfaff' via golang-nuts
ng.org/p/IQV5LTAIuDr On Saturday, 25 July 2020 at 22:22:24 UTC+2 Ian Lance Taylor wrote: > On Sat, Jul 25, 2020 at 11:47 AM 'Carla Pfaff' via golang-nuts > wrote: > > > > To expand on my post: > > It would be very consistent with the structure of regular parameter > lists. J

[go-nuts] Re: [generics] Fuzzer, Type Switches

2020-07-17 Thread 'Carla Pfaff' via golang-nuts
Why not write two functions? On Friday, 17 July 2020 at 21:36:38 UTC+2 jrh...@gmail.com wrote: > I was playing around with trying to use generics to de-interface-ify a > fuzzer implementation, and I ran into some stumbling blocks. > > is it possible to perform type switches? It seems the answer

Re: [go-nuts] Re: [generics] Feedback on optional type keyword experiment

2020-07-25 Thread 'Carla Pfaff' via golang-nuts
On Sunday, 26 July 2020 at 07:06:16 UTC+2 Carla Pfaff wrote: > Maybe gofmt could rewrite "interface{}" to "any", so there won't even be > such a question for new code. > When I think about it, that's probably not possible for gofmt to do in a safe way. -- You received this message because

Re: [go-nuts] Re: [generics] Feedback on optional type keyword experiment

2020-07-25 Thread 'Carla Pfaff' via golang-nuts
On Sunday, 26 July 2020 at 03:13:30 UTC+2 Denis Cheremisov wrote: > The bad with *any* in builtins is there will be questions "why you use > interface{}" if there's builtin *any?*", etc. If Go has generics I expect that people will use "interface{}"/"any" a lot less outside of type parameter

Re: [go-nuts] Re: Generics and parentheses

2020-07-16 Thread 'Carla Pfaff' via golang-nuts
Generics are not the most important part of the language/code. Let's not make them stick out like a sore thumb. On Thursday, 16 July 2020 at 22:12:17 UTC+2 jpap wrote: > On Thursday, 16 July 2020 at 12:51:03 UTC-7 Ian Lance Taylor wrote: > >> On Thu, Jul 16, 2020 at 12:41 PM joshua harr wrote:

Re: [go-nuts] Re: Generics and parentheses

2020-07-16 Thread 'Carla Pfaff' via golang-nuts
On Thursday, 16 July 2020 at 22:44:21 UTC+2 jpap wrote: > I don't think [[T]] is offensive to the surrounding code, and would love > to know what more people think. > It becomes even worse once you nest generic types: MyMap[[string, MyList[[int -- You received this message because

Re: [go-nuts] Re: [generics] Feedback on optional type keyword experiment

2020-07-25 Thread 'Carla Pfaff' via golang-nuts
I don't see why it should be in the grammar. Just a regular type alias for interface{} in the builtin scope, a regular predeclared identifier. It wouldn't break anyone's code. If someone already has an 'any' type or variable in their package their version shadows the builtin one, and they can

Re: [go-nuts] Re: Generics, please go away!

2020-12-22 Thread 'Carla Pfaff' via golang-nuts
On Tuesday, 22 December 2020 at 20:09:42 UTC+1 al...@pbrane.org wrote: > Please don't minimize or silence the lived experience > of people disproportionately affected by generics. > > We should protect non-generic function bodies. > > Concrete code matters. > Tasteless attempt at humour. --

[go-nuts] Re: program times out on go playground and runs but with race on mac running go1.16beta

2021-01-20 Thread 'Carla Pfaff' via golang-nuts
result <- Event{event, err} reads the `err` variable in one goroutine, and err = watcher.Add(dir) writes the same `err` variable in another goroutine. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and

Re: [go-nuts] instead of generics, why cant we just implement an "any" builtin?

2021-01-19 Thread 'Carla Pfaff' via golang-nuts
On Tuesday, 19 January 2021 at 15:39:25 UTC+1 m8il...@gmail.com wrote: > Seems to me that most generics implementations use a capital letter > abstracted type syntax that I hate. > This is just a convention and not part of the syntax, which means it's irrelevant to the discussion about the

Re: [go-nuts] Restrict general type parameter identifiers to be a single uppercase ascii letter.

2021-01-20 Thread 'Carla Pfaff' via golang-nuts
On Wednesday, 20 January 2021 at 10:05:24 UTC+1 cham...@gmail.com wrote: > A bit out of subject but the naming with generics has always bothered me. > It's more of an general observation and don't have a solution for it. > I think we all agree that naming types and variables is important. Why

[go-nuts] Re: calling cmd

2021-01-28 Thread 'Carla Pfaff' via golang-nuts
"htop" doesn't exit (the channel read blocks until exit), and it uses ANSI escape codes for colorful output. You'd be better served by "top -b -n 1" (Linux) or "top -l1" (macOS). -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe

Re: [go-nuts] What compatibility of go/ast, go/types, go/packages packages is planned, if any, when transitioning toward go2 ?

2021-01-28 Thread 'Carla Pfaff' via golang-nuts
On Wednesday, 27 January 2021 at 23:28:17 UTC+1 Ian Lance Taylor wrote: > To be clear, there is no Go 2, and there are no plans for Go 2. > For someone who follows the mailing lists and issue comments this has been known for a while, but it's easy to see where the confusion comes from, given

[go-nuts] Re: Where can I get a complete list of enhancements or changes of the golang spec (Version of Feb 10, 2021) agaisnt previous (Version of Jan 14, 2020)

2021-06-12 Thread 'Carla Pfaff' via golang-nuts
On Saturday, 12 June 2021 at 16:53:01 UTC+2 Benjamin wrote: > > Previously it took a long time to read through the golang spec of version > of Jan 14, 2020. The newest golang spec is Version of Feb 10, 2021. I > really don't want to read through all the spec again. Is there a summary on > the

[go-nuts] Re: gonum plot : font error

2021-05-17 Thread 'Carla Pfaff' via golang-nuts
You should really use modules. The module name is "gonum.org/v1/plot", not "github.com/gonum/plot". $ mkdir scatter-demo $ cd scatter-demo $ go mod init scatter-demo $ edit main.go # Copy and paste code from https://gist.github.com/sbinet/602522b7399ead414e279e2261d81095 into main.go # Replace

[go-nuts] Re: Is it possible to embed generic structs with go2go?

2021-02-09 Thread 'Carla Pfaff' via golang-nuts
It seems to be this issue: https://github.com/golang/go/issues/40814 -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To

[go-nuts] Re: package is not in GOROOT

2021-04-06 Thread 'Carla Pfaff' via golang-nuts
On Tuesday, 6 April 2021 at 02:13:14 UTC+2 rob wrote: > I'm still struggling w/ modules to get my code to compile. This example > is on Win10 using go 1.16.3 > > ~/go/src/rpng/rpng.go > ~/go/src/tokenize/tokenize.go > ~/go/src/hpcalc2/hpcalc2.go > > Put them in a directory, e.g. "rob". This

[go-nuts] Re: go get v git clone

2021-03-12 Thread 'Carla Pfaff' via golang-nuts
You use git clone. Go get is for adding a dependency to a project. Also how do I delete something I go getted? > ~/go/pkg/mod is just a local cache, nothing you work in. You can clear the whole module cache with go clean -modcache -- You received this message because you are subscribed to

Re: [go-nuts] sort string slice like it contains key,val

2021-03-13 Thread 'Carla Pfaff' via golang-nuts
On Saturday, 13 March 2021 at 14:44:05 UTC+1 mlevi...@gmail.com wrote: > the sort package from the stdlib, it contains an interface that you can > easily implement for such problematics :) > Like this: https://play.golang.org/p/eoLJ2aVAWkD -- You received this message because you are

Re: [go-nuts] No generic, part -2

2021-03-13 Thread 'Carla Pfaff' via golang-nuts
On Saturday, 13 March 2021 at 15:31:05 UTC+1 Space A. wrote: > There wasn't even a poll or anything. So the question of whether this > topic should be dropped completely (a lot of reasons why) has not been > thought out. > It was already explained that Go development is not driven by polls or

Re: [go-nuts] How to search standard libarary?

2021-03-16 Thread 'Carla Pfaff' via golang-nuts
On Tuesday, 16 March 2021 at 16:53:01 UTC+1 jake...@gmail.com wrote: > I would love to hear from someone involved why the go team decided to > remove this feature from the official Go website. > The reasons for removing the search are documented in the accompanying issue:

[go-nuts] Re: How to search standard libarary?

2021-03-16 Thread 'Carla Pfaff' via golang-nuts
On Tuesday, 16 March 2021 at 15:09:25 UTC+1 jake...@gmail.com wrote: > Any suggestions? You can use this: https://cs.opensource.google/go -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving

Re: [go-nuts] Re: now that the election is over can we please remove the political ad for golang.org

2021-03-17 Thread 'Carla Pfaff' via golang-nuts
It's not an uncommon practice for teams that run a public website to raise awareness for a good cause, usually by supporting fundraising for a social nonprofit charitable organization. Some choose a children's cancer charity or the Wikimedia foundation, this is what the Go team chose. This does

[go-nuts] Re: nice user survey re Go-lang

2021-03-17 Thread 'Carla Pfaff' via golang-nuts
It's a nice survey indeed. This is the original source of the article: https://blog.golang.org/survey2020-results -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email

Re: [go-nuts] package is not in GOROOT

2021-04-07 Thread 'Carla Pfaff' via golang-nuts
On Thursday, 8 April 2021 at 02:11:50 UTC+2 rob wrote: > Yes, you are absolutely correct that I've been struggling w/ modules. > > Would it be a bad idea to use my ~go/src as a module? > > cd ~/go/src > > go mod init src > > go mod tidy --> do I need this? > > And then I would have

Re: [go-nuts] Modules... why it has to be so painfull?

2021-04-08 Thread 'Carla Pfaff' via golang-nuts
On Thursday, 8 April 2021 at 12:48:28 UTC+2 nick@gmail.com wrote: > But what if you don't even have a domain for your source code? Sure you > can use a fake domain like "foo.example" > It doesn't have to be a fake domain name, just a module name, e.g. "foo". > and then use replace, and

[go-nuts] Re: Modules... why it has to be so painfull?

2021-04-09 Thread 'Carla Pfaff' via golang-nuts
On Friday, 9 April 2021 at 17:38:12 UTC+2 gonutz wrote: > A replace in the go.mod file is of no help here because I still have to > specify a require with a concrete version or commit hash for the library. > This means I cannot just change the code in the library module, I also have > to

[go-nuts] Re: Go module dependency debugging workflow

2021-04-09 Thread 'Carla Pfaff' via golang-nuts
On Friday, 9 April 2021 at 17:38:12 UTC+2 gonutz wrote: > I could create a local commit to the library or create a new debug branch > in my local copy of the library. Then I insert my debug code and commit it. > Then I point my main program's go.mod file at the new commit/branch, adding > a

[go-nuts] Re: go get not working in Go 1.16

2021-02-16 Thread 'Carla Pfaff' via golang-nuts
On Tuesday, 16 February 2021 at 22:57:07 UTC+1 pkle...@xs4all.nl wrote: > Also, you can't use local packages without a dot in the name. > I do this all the time. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group

Re: [go-nuts] Error handling

2021-02-18 Thread 'Carla Pfaff' via golang-nuts
On Thursday, 18 February 2021 at 09:34:35 UTC+1 Amnon wrote: > OT, but what has happened to the Go 2 error handling proposals? > I heard that the original check proposal was abandoned because of the > unfortunate interaction with defer. > > Any updates? After the "check" proposal the Go team

[go-nuts] Re: How do you test an unpublished module?

2021-02-20 Thread 'Carla Pfaff' via golang-nuts
The modules documentation has a section on this: "Developing and testing against unpublished module code" https://golang.org/doc/modules/managing-dependencies#tmp_9 On Saturday, 20 February 2021 at 13:10:38 UTC+1 pkle...@xs4all.nl wrote: > Is there a way to tell go.mod that it should use local

[go-nuts] Re: macos file provider handling with golang

2021-09-24 Thread 'Carla Pfaff' via golang-nuts
On Friday, 24 September 2021 at 18:00:21 UTC+2 va...@selfip.ru wrote: > Hi. Does anybody knows how to call macos functions from go? > Mostly my question about file provider methods, i want to write > something that works as file provider for macos > https://github.com/progrium/macdriver

[go-nuts] Re: New site go.dev is awful

2021-11-23 Thread 'Carla Pfaff' via golang-nuts
On Tuesday, 23 November 2021 at 19:46:19 UTC+1 poe...@gmail.com wrote: > I can't think of one thing I like about the new site compared to the old > one, and would like to see the old site make a comeback. > Whenever a popular website launches a redesign a certain percentage don't like it. I've

[go-nuts] Re: New site go.dev is awful

2021-11-24 Thread 'Carla Pfaff' via golang-nuts
On Wednesday, 24 November 2021 at 22:53:33 UTC+1 ben...@gmail.com wrote: > 2) The download link is for the Windows binary, and I'm running Linux. > Would be nice if it could try to auto-detect based on my User-Agent, which > includes the words "X11", "Ubuntu", and "Linux". > The website

Re: [go-nuts] Re: Tour of Go seems to be broken.

2021-11-25 Thread 'Carla Pfaff' via golang-nuts
On Thursday, 25 November 2021 at 18:43:44 UTC+1 bmar...@gmail.com wrote: > I often give some training in my company about Go and I recommend the Tour > of Go as introducing but since September, french Tour of Go returns a http > 500 error (cf. my previous message >

[go-nuts] Re: x/exp/slices: add Map/Extract function

2022-03-20 Thread 'Carla Pfaff' via golang-nuts
On Sunday, 20 March 2022 at 18:14:15 UTC+1 cpu...@gmail.com wrote: > Has this already been discussed? > Yes: https://github.com/golang/go/discussions/47203#discussioncomment-1005237 -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

[go-nuts] Re: Best way to mark unused parameters/error values reported by linter

2023-03-08 Thread 'Carla Pfaff' via golang-nuts
If a linter reports false positives I don't use it. I would never uglify my source code to please a linter. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to

[go-nuts] Re: GLog library can't be used in Golang 1.18 due to "abortProcess redeclared in this block" error

2023-03-22 Thread 'Carla Pfaff' via golang-nuts
glog_file_other.go uses the "unix" build constraint, which was introduced in Go 1.19: https://tip.golang.org/doc/go1.19#go-unix Go 1.18 doesn't know about it. Since Go 1.18 is no longer supported (only the last two main releases are supported) it's either time to update your Go version to 1.19

[go-nuts] Re: why strings.ToLower change the "Ⅱ" to "ii" ?

2023-02-10 Thread 'Carla Pfaff' via golang-nuts
It's actually "ⅱ" (one rune), not "ii" (two runes). Because Unicode defines "ⅱ" (U+2171) as the lowercase character for "Ⅱ" (U+2161), see https://www.compart.com/en/unicode/U+2161 -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe

[go-nuts] Unhappy with the official generics tutorial

2024-02-22 Thread 'Carla Pfaff' via golang-nuts
The Go documentation, available at https://go.dev/doc/, features only one tutorial dedicated to generics, found at https://go.dev/doc/tutorial/generics. This tutorial lacks any examples employing the 'any' constraint, nor does it mention it. Instead, it begins with the use of an 'int64 |

Re: [go-nuts] Unhappy with the official generics tutorial

2024-02-22 Thread 'Carla Pfaff' via golang-nuts
The feedback was not specific to the "SumIntsOrFloats" example in the tutorial. The tutorial fails to demonstrate any generic data structures utilizing the "[T any]" constraint or a function with an 'any' constraint, such as "slices.Clone[S ~[]E, E any](s S) S". This omission is notable

Re: [go-nuts] Unhappy with the official generics tutorial

2024-02-22 Thread 'Carla Pfaff' via golang-nuts
On Thursday 22 February 2024 at 10:19:58 UTC+1 Jan Mercl wrote: On Thu, Feb 22, 2024 at 10:06 AM 'Carla Pfaff' via golang-nuts wrote: > This omission is notable considering "any" is among the most frequently used constraints in writing generic code. Interesting to know, I'd

[go-nuts] Re: just started using modules, what have i missed?.

2024-05-02 Thread 'Carla Pfaff' via golang-nuts
It's not clear what your end goal is. github.com/vulkan-go/vulkan is a library. Do you want to use it as a dependency in one of your projects or not? If you want to use it as a dependency, then yes, "go mod init " your project first before adding a dependency with "go get". On Thursday 2 May