Skip to content

Commit

Permalink
remove //nolint as it does not work
Browse files Browse the repository at this point in the history
  • Loading branch information
alovak committed Sep 22, 2023
1 parent 805db80 commit a71fbc4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion field/composite.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ type CompositeWithSubfields interface {
ConstructSubfields()
}

// ConstructSubfields creates subfields according to the spec
// this method is used when composite field is created without
// calling NewComposite (when we create message spec and composite spec)
func (f *Composite) ConstructSubfields() {
if f.subfields == nil {
f.subfields = CreateSubfields(f.spec)
Expand Down Expand Up @@ -120,7 +123,7 @@ func (f *Composite) GetSubfields() map[string]Field {
// will result in a panic.
func (f *Composite) SetSpec(spec *Spec) {
if err := spec.Validate(); err != nil {
panic(err) //nolint // as specs moslty static, we panic on spec validation errors
panic(err) // as specs moslty static, we panic on spec validation errors
}
f.spec = spec

Expand Down
2 changes: 1 addition & 1 deletion message.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ type Message struct {
func NewMessage(spec *MessageSpec) *Message {
// Validate the spec
if err := spec.Validate(); err != nil {
panic(err) //nolint // as specs moslty static, we panic on spec validation errors
panic(err) // as specs moslty static, we panic on spec validation errors
}

fields := spec.CreateMessageFields()
Expand Down
2 changes: 1 addition & 1 deletion test/fuzz-reader/reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func Fuzz(data []byte) int {

_, err = message.Pack()
if err != nil {
panic(fmt.Errorf("failed to pack unpacked message: %w", err)) //nolint
panic(fmt.Errorf("failed to pack unpacked message: %w", err))
}

return 1
Expand Down

0 comments on commit a71fbc4

Please sign in to comment.