Skip to content

StringToSliceHookFunc only works on slice of strings #69

Open
@vincentbernat

Description

@vincentbernat

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions