Skip to content

Conversation

yasirfolio3
Copy link
Contributor

@yasirfolio3 yasirfolio3 commented Aug 31, 2022

Fixes:

Tests:

  • All tests should pass

Jira ticket:

https://optimizely.atlassian.net/browse/OASIS-8593

Copy link

@jaeopt jaeopt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A clarification

}
if _, ok := value.(bool); ok {
switch value.(type) {
case string, float64, int, bool:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this change work for float32, int8, which should be accepted?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://go.dev/tour/basics/11
should give all types?

Copy link

@jaeopt jaeopt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
wondering what's wrong with the original if-based one. It'll cover all types.

@yasirfolio3
Copy link
Contributor Author

LGTM wondering what's wrong with the original if-based one. It'll cover all types.

i tried the new tests for both new and previous code, behaviour was the same. We would've required if checks for all types too.

Copy link

@jaeopt jaeopt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@msohailhussain msohailhussain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@Mat001 Mat001 merged commit 40f717f into master Sep 1, 2022
@Mat001 Mat001 deleted the yasir/attribute-validation-fixes branch September 1, 2022 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants