-
Notifications
You must be signed in to change notification settings - Fork 100
Fix use StrictUnmarshal for app protect yaml unmarshalling #76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
UnmarshalStrict will ensure the payload matches all fields on the struct. See: https://pkg.go.dev/gopkg.in/yaml.v2#UnmarshalStrict for details
wicklander-bryant
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks Dean!
| defer func() { | ||
| err := os.Remove(tc.versionFile) | ||
| assert.Nil(t, err) | ||
| require.NoError(t, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we consistently use assert across the board. Is require a better option? If it is, should we change all assert.Nil on errors to require? I don't mind as long as we are consistent
Proposed changes
yaml.StrictUnmarshalin place ofyaml.UnmarshalChecklist
Before creating a PR, run through this checklist and mark each as complete.
CONTRIBUTINGdocumentREADME.md)