[go-nuts] Re: heap profiling does not work on M2 MacBook air?

2023-03-03 Thread Jochen Voss
Hi Peter, Thanks again for looking into this, and for your help! You mention that the blog post was long ago. I wonder whether the code to write profile information is covered by the compatibility promise. If so, probably the legacy WriteHeapProfile function could be made to implement the

[go-nuts] Re: Nested structs

2023-03-03 Thread Brian Candler
Use pointers. https://go.dev/play/p/V9M_XxX052J On Friday, 3 March 2023 at 13:18:30 UTC BARIKUMA MONDELO wrote: > Is it possible to have two structs both declared in each other, something > like this > > type human struct { > name string > age int > address Address > }

[go-nuts] Nested structs

2023-03-03 Thread BARIKUMA MONDELO
Is it possible to have two structs both declared in each other, something like this type human struct { name string age int address Address } type Address struct { country, city string postalCode uint human } -- You received this message because

[go-nuts] Generic Wrappers that do reflection on Initialization

2023-03-03 Thread Peter Müller
Hello, would you assess the following usage of `Var[T any]`, `v = new(Var[T])` and `var person = rel.NewVar[Person]("person")` as valid pattern, that also enables it to be used in further generic methods, or would you rather prefer a codegen approach? ```go type Var[T any] struct {

[go-nuts] Correctly tagging a module in a subdirectory of a Github repo

2023-03-03 Thread Jim Idle
For historic reasons, which are too difficult to change (and pre-modules), the runtime module for the ANTLR v4 Go runtime is held in a subdirectory of the antlr/antlr4 Github repo. This is complicated by the fact that organizations have written scripts into their build to copy the source code into

[go-nuts] Re: alignment of stack-allocated variables?

2023-03-03 Thread 'Keith Randall' via golang-nuts
If you're using unsafe anyway, I'd go the other direction, casting from the larger alignment to the smaller one. That avoids any alignment concerns. var x uint32 b := (*[4]byte)(unsafe.Pointer())[:] r.buff.Read(b) return x I would encourage you to use encoding/binary though. It all works out

[go-nuts] alignment of stack-allocated variables?

2023-03-03 Thread TheDiveO
In dealing with Linux netlink messages I need to decode and encode uint16, uint32, and uint64 numbers that are in an arbitrary aligned byte buffer in an arbitrary position. In any case, these numbers are in native endianess, so I would like to avoid having to go through encoding/binary. buff

[go-nuts] Re: Correctly tagging a module in a subdirectory of a Github repo

2023-03-03 Thread Jim Idle
Just to follow up on my question, I have read all the docs again, and I am thinking that I used the wrong tag syntax. I think it should either be: git tag -a runtime/Go/antlr/v4/v4.12.0 -m "ssads" runtime/Go/antlr/v4 or just git tag -a runtime/Go/antlr/v4/v4.12.0 -m "ssads" Am I on the