|
|
|
|
|
by steveklabnik
2688 days ago
|
|
This is a pain point, but it’s not due to slices; it’s the “self-referential struct problem.” There are various solutions, as you note, but it can be annoying, it’s true. It’s a tough one; in the general case, it’s saving you from problems, but when you know you’re not going to hit those edge cases, it’s less than ideal. |
|
It doesn't seem unsafe to have a struct field refer to another member of that struct, but maybe I'm missing something.