Skip to content

Commit 908eaed

Browse files
authored
Merge pull request #408 from onelrdm/master
skip - tag before spliting parts
2 parents 819acad + 1ba732a commit 908eaed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

reflect_extension.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -341,10 +341,10 @@ func describeStruct(ctx *ctx, typ reflect2.Type) *StructDescriptor {
341341
if ctx.onlyTaggedField && !hastag && !field.Anonymous() {
342342
continue
343343
}
344-
tagParts := strings.Split(tag, ",")
345344
if tag == "-" {
346345
continue
347346
}
347+
tagParts := strings.Split(tag, ",")
348348
if field.Anonymous() && (tag == "" || tagParts[0] == "") {
349349
if field.Type().Kind() == reflect.Struct {
350350
structDescriptor := describeStruct(ctx, field.Type())

0 commit comments

Comments
 (0)