Skip to content

StringToSliceHookFunc only works on slice of strings #69

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

Open
vincentbernat opened this issue Feb 15, 2025 · 0 comments · May be fixed by #70
Open

StringToSliceHookFunc only works on slice of strings #69

vincentbernat opened this issue Feb 15, 2025 · 0 comments · May be fixed by #70

Comments

@vincentbernat
Copy link

Hey!

Since 84b9bc9, StringToSliceHookFunc() only works when the target is a slice of strings. Previously, it worked for any slices, notably slices of int for example.

		if f.Kind() != reflect.String {
			return data, nil
		}
		if t != reflect.SliceOf(f) {
			return data, nil
		}

Since f is a string value because of the first condition, the target has to be a slice of strings.

I'll propose a PR shortly to fix that.

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 a pull request may close this issue.

1 participant