Skip to content

fix(variable): treat unexported struct fields as nil instead of panicking#377

Open
SAY-5 wants to merge 1 commit into
flosch:masterfrom
SAY-5:fix/204-unexported-struct-field
Open

fix(variable): treat unexported struct fields as nil instead of panicking#377
SAY-5 wants to merge 1 commit into
flosch:masterfrom
SAY-5:fix/204-unexported-struct-field

Conversation

@SAY-5
Copy link
Copy Markdown

@SAY-5 SAY-5 commented May 12, 2026

Accessing an unexported struct field from a template (e.g. {{ item.index }} where index is lowercase) currently panics with "reflect.Value.Interface: cannot return value obtained from unexported field". This resolves such fields to nil, matching Django's behavior of rendering them empty. Closes #204.

@sonarqubecloud
Copy link
Copy Markdown

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.

panic: reflect.Value.Interface: cannot return value obtained from unexported field or method

1 participant