Skip to content

Commit

Permalink
Add StructTag linter (ava-labs#2230)
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenButtolph authored Nov 14, 2022
1 parent 2720392 commit 6cf3f67
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ linters:
linters-settings:
revive:
rules:
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#struct-tag
- name: struct-tag
disabled: false
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#unexported-naming
- name: unexported-naming
disabled: false
Expand Down
2 changes: 1 addition & 1 deletion codec/test_codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ func TestSerializeUnexportedField(codec GeneralCodec, t testing.TB) {

type s struct {
ExportedField string `serialize:"true"`
unexportedField string `serialize:"true"`
unexportedField string `serialize:"true"` //nolint:revive
}

myS := s{
Expand Down
3 changes: 2 additions & 1 deletion vms/secp256k1fx/output_owners.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,11 @@ type OutputOwners struct {
Locktime uint64 `serialize:"true" json:"locktime"`
Threshold uint32 `serialize:"true" json:"threshold"`
Addrs []ids.ShortID `serialize:"true" json:"addresses"`

// ctx is used in MarshalJSON to convert Addrs into human readable
// format with ChainID and NetworkID. Unexported because we don't use
// it outside this object.
ctx *snow.Context `serialize:"false"`
ctx *snow.Context
}

// InitCtx assigns the OutputOwners.ctx object to given [ctx] object
Expand Down

0 comments on commit 6cf3f67

Please sign in to comment.