Skip to content

Commit

Permalink
fix grp init bug
Browse files Browse the repository at this point in the history
  • Loading branch information
momaek committed Apr 19, 2021
1 parent 816cb5f commit 670400a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,9 @@ func (c *config) preProcessStruct(st *ast.StructType, inline ...bool) {
if lineNum-lastLineNum >= 2 {
lastLineNum = lineNum
c.groups = append(c.groups, grp)
grp = group{}
grp = group{
maxTagNum: tags.Len(),
}
}

lastLineNum = lineNum
Expand Down
4 changes: 2 additions & 2 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ type TestStruct struct {
T time.Time `json:"t" xml:"t" bson:"t"`
Fset Fset `json:"fset" xml:"fset" bson:"fset"`

CreatedAt int64 `json:"created_at,omitempty" xml:"created_at" bson:"created_at,omitempty"`
UpdatedAt int64 `json:"updated_at,omitempty" xml:"updated_at,omitempty" bson:"created_at"`
CreatedAt int64 `json:"created_at,omitempty" xml:"created_at" bson:"created_at"`
UpdatedAt int64 `json:"updated_at,omitempty" xml:"updated_at,omitempty"`
}

type Fset struct{}

0 comments on commit 670400a

Please sign in to comment.