Skip to content

Commit

Permalink
Returning a parser with passed down opts
Browse files Browse the repository at this point in the history
  • Loading branch information
xBlaz3kx committed Nov 10, 2024
1 parent cb0089b commit 2462231
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,13 @@ func NewParser(opts ...Opt) *Parser {
func (p *Parser) ParseOcmfMessageFromString(data string) *Parser {
payloadSection, signature, err := parseOcmfMessageFromString(data)
if err != nil {
return &Parser{err: err}
return &Parser{err: err, withAutomaticValidation: p.withAutomaticValidation}
}

return &Parser{
payload: payloadSection,
signature: signature,
payload: payloadSection,
signature: signature,
withAutomaticValidation: p.withAutomaticValidation,
}
}

Expand Down

0 comments on commit 2462231

Please sign in to comment.