Skip to content

MapTo: error on nil struct pointer instead of panic - #392

Merged
unknwon merged 1 commit into
go-ini:v1from
team-humaki:fix-mapto-nil-struct-pointer
Nov 11, 2026
Merged

unknwon merged 1 commit into
go-ini:v1from
team-humaki:fix-mapto-nil-struct-pointer

Conversation

@team-humaki

Copy link
Copy Markdown

Summary

MapTo(&cfg) when cfg is a nil *T panicked inside mapToField. Return nil pointer to a struct instead (#369).

Test plan

  • go test ./...
  • TestMapToNilStructPointer

Fixes #369

Calling MapTo(&cfg) when cfg is a nil *T used to panic in mapToField.
Return a clear error instead (go-ini#369).

Fixes go-ini#369
@unknwon
unknwon merged commit f134770 into go-ini:v1 Nov 11, 2026
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: nil struct pointer to MapTo

2 participants