1pkg / gopium

Gopium 🌺: Smart Go Structures Optimizer and Manager
MIT License
209 stars 7 forks source link

embedding struct tags #22

Closed Frosin closed 3 years ago

Frosin commented 3 years ago

if click gopium pack: image after: image result: struct have invalid tags

1pkg commented 3 years ago

@Frosin thank you for reporting, I will check it out.

1pkg commented 3 years ago

Okay, it should be resolved now in v1.3.0 (hopefully). @Frosin please try it out. The issue was long running issue about multiple embedded fields sorting for structure memory packing https://github.com/1pkg/gopium/issues/2. I figured, that just using naked types without extra indexes should be enough for embedded fields. Because go forbids having two embedded types with exact the same type hence type by itself should be unique identifier for embedded fields.

P.S. @Frosin, I've even added your example to the tests https://github.com/1pkg/gopium/blob/master/tests/data/embedded/file.go#L16 https://github.com/1pkg/gopium/blob/master/walkers/wast_test.go#L360 Hope you don't mind about this.

1pkg commented 3 years ago

Closing this as resolved.

Frosin commented 3 years ago

It works thanks