Skip to content
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

[WIP]Feature/fix width/height data type #195

Closed

Conversation

teraken0509
Copy link
Contributor

@teraken0509 teraken0509 commented Nov 14, 2018

Fixes https://github.com/terraform-providers/terraform-provider-datadog/pull/118

  • Datadog width param takes int & string like 100%
  • Datadog height param also can be int or string

Height: datadog.Int(600),
Width: datadog.Int(800),
Height: datadog.JsonNumber("600"),
Width: datadog.JsonNumber("800"),
Copy link

Choose a reason for hiding this comment

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

Similar to #194, this code will fail downstream during marshalling, right before sending the payload to the client. Try setting Width: datadog.JsonNumber("100%"), here to expose the issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for review.
Fixed it.

@teraken0509 teraken0509 changed the title Feature/fix width data type [WIP]Feature/fix width data type Nov 20, 2018
@teraken0509 teraken0509 force-pushed the feature/fix-width-data-type branch from 12ec6cf to bc494cb Compare November 20, 2018 02:50
@teraken0509 teraken0509 changed the title [WIP]Feature/fix width data type Feature/fix width/height data type Nov 20, 2018
"fmt"
)

// WidthS ...
type WidthS string
Copy link

Choose a reason for hiding this comment

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

Why not using PrecisionT from #194?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

#194 isn't merged yet.
And using PrecisionT as width or height several difficulty for user to consider its meaning.

If used same struct in whole this package, i think shoud be better assign general name.

Copy link

Choose a reason for hiding this comment

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

Can you comment on #194 asking for a more generic name? I believe this will be merged more easily if you make it rely on existing code

Copy link

Choose a reason for hiding this comment

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

#194 was merged, you could change the name of the custom type in this PR

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i split PR at #198 .
After merge, i rebase this pr.

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.

2 participants