Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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