diff --git a/mapstructure.go b/mapstructure.go index e77e63ba..56c749bf 100644 --- a/mapstructure.go +++ b/mapstructure.go @@ -1434,8 +1434,8 @@ func (d *Decoder) decodeStructFromMap(name string, dataVal, val reflect.Value) e if tagValue == "" && d.config.IgnoreUntaggedFields { continue } - tagValue = strings.SplitN(tagValue, ",", 2)[0] if tagValue != "" { + tagValue, _, _ = strings.Cut(tagValue, ",") fieldName = tagValue }