Explorar el Código

skip - tag before spliting parts

onelrdm hace 6 años
padre
commit
1ba732a07d
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      reflect_extension.go

+ 1 - 1
reflect_extension.go

@@ -341,10 +341,10 @@ func describeStruct(ctx *ctx, typ reflect2.Type) *StructDescriptor {
 		if ctx.onlyTaggedField && !hastag && !field.Anonymous() {
 			continue
 		}
-		tagParts := strings.Split(tag, ",")
 		if tag == "-" {
 			continue
 		}
+		tagParts := strings.Split(tag, ",")
 		if field.Anonymous() && (tag == "" || tagParts[0] == "") {
 			if field.Type().Kind() == reflect.Struct {
 				structDescriptor := describeStruct(ctx, field.Type())