Skip to content

Commit d8a15bc

Browse files
committed
fix bug
1 parent 7a6f78d commit d8a15bc

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tagalign.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,11 @@ func (w *Helper) Process(pass *analysis.Pass) { //nolint:gocognit
197197
maxTagNum = max(maxTagNum, tags.Len())
198198

199199
if w.sort {
200-
notSortedTagsGroup = append(notSortedTagsGroup, tags.Tags())
200+
cp := make([]*structtag.Tag, tags.Len())
201+
for i, tag := range tags.Tags() {
202+
cp[i] = tag
203+
}
204+
notSortedTagsGroup = append(notSortedTagsGroup, cp)
201205
sortBy(w.fixedTagOrder, tags)
202206
}
203207

0 commit comments

Comments
 (0)