Skip to content

Commit

Permalink
dev: add fix test for tagalign linter (#4594)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandear authored Mar 29, 2024
1 parent 17a65b1 commit f96314f
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions test/testdata/fix/in/tagalign.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//golangcitest:args -Etagalign
//golangcitest:config_path testdata/configs/tagalign_strict.yml
//golangcitest:expected_exitcode 0
package p

import "time"

type TagAlignExampleStrictKO struct {
Foo time.Time `json:"foo,omitempty" validate:"required" zip:"foo"`
FooBar struct{} `gorm:"column:fooBar" validate:"required" zip:"fooBar" xml:"fooBar" json:"fooBar,omitempty" yaml:"fooBar"`
}
11 changes: 11 additions & 0 deletions test/testdata/fix/out/tagalign.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
//golangcitest:args -Etagalign
//golangcitest:config_path testdata/configs/tagalign_strict.yml
//golangcitest:expected_exitcode 0
package p

import "time"

type TagAlignExampleStrictKO struct {
Foo time.Time ` json:"foo,omitempty" validate:"required" zip:"foo"`
FooBar struct{} `gorm:"column:fooBar" json:"fooBar,omitempty" validate:"required" xml:"fooBar" yaml:"fooBar" zip:"fooBar"`
}

0 comments on commit f96314f

Please sign in to comment.