Debian Patches

Status for golang-github-go-viper-mapstructure/2.5.0-3

Patch Description Author Forwarded Bugs Origin Last update
0001-test-regression-test-for-mapping-into-unexported-fi.patch fix: don't panic when squashing unexported embedded pointers
Validate the behaviour of returning an error instead
of panicking when trying to set a value for an
unexported variable.

Decoding a map into a struct with an embedded pointer
to an unexported type tagged with `mapstructure:",squash"`
currently panics with:

`reflect: reflect.Value.Set using value obtained using unexported
field`

Add TestDecode_EmbeddedUnexportedPointerSquash_FromMapToStruct to
lock in the expected behaviour: Decode returns an error containing
"unsupported type for squash" rather than panicking.

This behaviour change was noticed by the
`Test_EmbeddedPrivateStructPointer` in anchore/fangs:
https://github.com/anchore/fangs/blob/d9f7358ffc5f9c1935fd3bbc2e5a16fb92ff5b6c/load_test.go#L731
Rafael Passos <rafael@rcpassos.me> yes 2026-09-17
0002-fix-don-t-panic-when-squashing-unexported-embedded-p.patch fix: don't panic when squashing unexported embedded pointers
Guard the allocation with CanSet() and return the previous
"unsupported type for squash" error for fields that cannot be set, rather
than panicking.
Rafael Passos <rafael@rcpassos.me> yes 2026-09-17

All known versions for source package 'golang-github-go-viper-mapstructure'

Links