Skip to content

encoder: skip unexported named fields - #254

Open
team-humaki wants to merge 1 commit into
gorilla:mainfrom
team-humaki:skip-unexported-fields
Open

team-humaki wants to merge 1 commit into
gorilla:mainfrom
team-humaki:skip-unexported-fields

Conversation

@team-humaki

Copy link
Copy Markdown

Unexported named fields panicked on Decode when reflect.Value.Set ran on a value from another package, including a nil unexported embedded pointer. Encode also wrote those fields.

Skip unexported named fields on Encode. On Decode, do not Set when CanSet is false, and walk field indexes without panicking on a nil embed.

Fixes #234

Unexported named fields panicked on Decode (Set on values obtained
from another package, including nil embedded pointers) and were
included in Encode. Skip them, and do not Set when CanSet is false.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Do not encode unexported fields

1 participant