Re: [go-nuts] go run, add string value definition with space

2023-11-13 Thread 'Michel Levieux' via golang-nuts
Hi! Not an expert at all, but it seems the format is "package-qualified.identifier=value", with value being able to just contain spaces out of the box, so running: go run -ldflags="-X 'main.MyVar=this is a string'" main.go works for me. Note that for parsing the whole thing correctly, the whole

Re: [go-nuts] In golang spec, if it cast the variable, pointer that cast returns is changed?

2023-10-10 Thread 'Michel Levieux' via golang-nuts
Hi, Note that this has nothing to do with casting. `after` and `before` are not pointers, they're plain old `int` variables (or `DefinedInt` in your example but that does not change anything). When you do `after := whatever`, you're declaring (and assigning) a new variable `after` to hold the

[go-nuts] Re: First stable version of several package under golang.org/x/

2022-10-27 Thread 'Michel Levieux' via golang-nuts
Thank you for the detailed answer! Indeed this may not warrant any announcement, just wanted to be sure I wasn't missing something! :sweat_smile: I'll follow that closely. Thanks! On Thursday, October 27, 2022 at 2:10:15 AM UTC+2 Heschi Kreinick wrote: > Yeah, text and tools were already

[go-nuts] First stable version of several package under golang.org/x/

2022-10-26 Thread 'Michel Levieux' via golang-nuts
Hi all, I was bumping the dependencies of our codebase today, and noticed that many packages under golang.org/x/ had upgraded from a pseudo-version to a real, semver version: - golang.org/x/net v0.

Re: [go-nuts] Generic func to transform []*x to []X if *x implements iface X?

2022-08-26 Thread 'Michel Levieux' via golang-nuts
I guess this defeats what you were trying to accomplish, but does this answer your needs? https://play.golang.com/p/5kPX8F_u24l Cheers, On Fri, Aug 26, 2022 at 9:42 AM Frank Schröder wrote: > Thank you. Are there plans to add a type constraint which would allow > this? Maybe something like

Re: [go-nuts] Generic interface compiles with incorrectly instantiated types

2022-06-21 Thread 'Michel Levieux' via golang-nuts
Hi, I'm not a generics expert either, but I think there is a misunderstanding here: The A in the Wrap[A any] is not the same as the A in Val[A any]. When you instantiate the Extract function with Extract[string], it expects a Wrap[string], which is, in fact, just a type implementing isWrap. The