Skip to content

fix: Load panics when trying to load a non primitive type field with a string inner type#84

Open
riftsin wants to merge 1 commit intojinzhu:masterfrom
riftsin:master
Open

fix: Load panics when trying to load a non primitive type field with a string inner type#84
riftsin wants to merge 1 commit intojinzhu:masterfrom
riftsin:master

Conversation

@riftsin
Copy link

@riftsin riftsin commented Jan 19, 2023

Hello everyone,

I recently stumbled across a bug when using this library, the following code panics:

	type myStringType string
	type myTestConfig struct {
		Name myStringType
	}
	var result myTestConfig
	key := "MYTEST_NAME"
	expected := "bob"
	os.Setenv(key, expected)
	New(&Config{
		ENVPrefix: "MYTEST",
	}).Load(&result) // panic

This MR fixes this issue.

…ve type of inner type string from environment, Load panics, this fix adresses this issue
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.

1 participant