From a71fbc4a09b2090cc7814e737e56f152c29fc5f5 Mon Sep 17 00:00:00 2001 From: Pavel Gabriel Date: Fri, 22 Sep 2023 18:52:06 +0200 Subject: [PATCH] remove //nolint as it does not work https://github.com/moov-io/infra/pull/280 --- field/composite.go | 5 ++++- message.go | 2 +- test/fuzz-reader/reader.go | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/field/composite.go b/field/composite.go index 2edeea52..27e9d976 100644 --- a/field/composite.go +++ b/field/composite.go @@ -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) @@ -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 diff --git a/message.go b/message.go index 9823085f..16c58b40 100644 --- a/message.go +++ b/message.go @@ -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() diff --git a/test/fuzz-reader/reader.go b/test/fuzz-reader/reader.go index c66c682c..8bb4aadc 100644 --- a/test/fuzz-reader/reader.go +++ b/test/fuzz-reader/reader.go @@ -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