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

ScheduleKeyDeletion returns DeletionDate in Standard Form #4

Open
nsmithuk opened this issue Apr 22, 2019 · 1 comment
Open

ScheduleKeyDeletion returns DeletionDate in Standard Form #4

nsmithuk opened this issue Apr 22, 2019 · 1 comment

Comments

@nsmithuk
Copy link
Owner

On successfully calling ScheduleKeyDeletion, the timestamp in the DeletionDate field returned from AWS is encoded in Scientific Notation/Standard Form. Local KMS returns the value as a standard integer.

For example:
AWS returns: 1.5565824E9
Local KMS returns: 1556582400

AWS' SDKs appear to transparently accept either correctly.

There appears no easy way to force Go to output the value as a number, in Scientific Notation. The community conscientious seems to be that as the interpreter should read both numbers identically, thus Go is working as expected.

@andrew-d
Copy link

There's always the option of writing a custom MarshalJSON method on a wrapper type, like so:
https://play.golang.org/p/3adteafwrAv

The strconv.FormatFloat formatting is also slightly different from the AWS format though, so it's likely to be annoying 😞

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

No branches or pull requests

2 participants