Skip to content

render: bind slice and map elements - #64

Open
team-humaki wants to merge 1 commit into
go-chi:masterfrom
team-humaki:bind-slice-map-elements
Open

team-humaki wants to merge 1 commit into
go-chi:masterfrom
team-humaki:bind-slice-map-elements

Conversation

@team-humaki

Copy link
Copy Markdown

Fixes #37

Bind walked struct fields that implement Binder, but not slice/array elements or map values. Child.Bind on []Child (and named slice types) never ran.

binder now walks those collections bottom-up, then the collection's own Bind when the type implements Binder. Nil named slices still get Bind so missing children can error.

go test -count=1 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bind not getting called on structs inside a slice

1 participant