1pkg/gopium

anonymous structures support

1pkg opened this issue · 1 comments

1pkg commented

Gopium supports only named structs as targets for all transformations.
Originally this was done by design, as supposedly all "important" structs, performance of which matters, should be named anyhow and originally it simplified internal implementation.
But there are some counterexample, for example take for consideration:

type Bank struct {
	// anonymous structure that won't be targeted by Gopium
	Departments []struct{
		ID string
		Open bool
		Workers int64
	}
	Assets float64
}

I still have doubts wherether it's important feature for Gopium or not.
As implementation will definitely require recurrent strategies. So generally for each struct we need to build structure tree and postorder traverse it, to support generic cases like this properly:

type a struct {
	b struct{
		c struct {
			d struct {
				e int32
			}
		}
	}
	f struct {
		g struct {
			h string
		}
		i struct {
			k string
		}
	}
}

So I'm opening this issue to gather feedback and ideas whether Gopium needs this feature or not.

1pkg commented

Closing this as non priority issue.