-
Notifications
You must be signed in to change notification settings - Fork 19
feat: add valid datafile version check #234
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
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.
Mostly ok, just have a suggestion
|
||
if !inSlice(datafileVersions, datafile.Version) { | ||
err = errors.New("unsupported datafile version") | ||
logger.Error(fmt.Sprintf("Version %s of datafile not supported", datafile.Version), 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.
Will be useful to say unable to initialize/update or something along those lines.
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.
One suggestion to use a map as opposed to a slice based off a SO article. Also standardizing on assert.Error
and assert.NoError
when checking for errors.
Summary
to be compatible with other sdk's, we are adding a check for a valid version of datafile. go-sdk supports only version 4 of datafile, same as the family of more recent sdk's.