{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/16172","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/16172/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/16172/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/16172/events","html_url":"https://github.com/kubernetes/kubernetes/issues/16172","id":113073436,"number":16172,"title":"self-contained Quantity type","user":{"login":"crawshaw","id":161319,"avatar_url":"https://avatars.githubusercontent.com/u/161319?v=3","gravatar_id":"","url":"https://api.github.com/users/crawshaw","html_url":"https://github.com/crawshaw","followers_url":"https://api.github.com/users/crawshaw/followers","following_url":"https://api.github.com/users/crawshaw/following{/other_user}","gists_url":"https://api.github.com/users/crawshaw/gists{/gist_id}","starred_url":"https://api.github.com/users/crawshaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crawshaw/subscriptions","organizations_url":"https://api.github.com/users/crawshaw/orgs","repos_url":"https://api.github.com/users/crawshaw/repos","events_url":"https://api.github.com/users/crawshaw/events{/privacy}","received_events_url":"https://api.github.com/users/crawshaw/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-23T18:21:09Z","updated_at":"2015-10-23T18:27:27Z","closed_at":null,"body":"The api package uses a Quantity type to represent MB/GB/MiB/GiB/etc quantities. Right now it depends on an old version of a third-party infinite-precision decimal arithmetic package.\r\n\r\nI believe it's possible to get the same effect with a type like:\r\n\r\n```\r\ntype Quantity struct {\r\n        base Format\r\n        mant int64\r\n        exp  int\r\n}\r\n\r\ntype Format int\r\n\r\nconst (\r\n        Base1000 Format = iota\r\n        Base1024\r\n)\r\n```\r\n\r\n...which would remove a lot of the sharp edges from inside its implementation. (And, one less dependency.) Would you accept a patch to do this?\r\n\r\n@lavalamp, a random googler who seems to have touched this code recently"},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/150655505","html_url":"https://github.com/kubernetes/kubernetes/issues/16172#issuecomment-150655505","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/16172","id":150655505,"user":{"login":"thockin","id":5595220,"avatar_url":"https://avatars.githubusercontent.com/u/5595220?v=3","gravatar_id":"","url":"https://api.github.com/users/thockin","html_url":"https://github.com/thockin","followers_url":"https://api.github.com/users/thockin/followers","following_url":"https://api.github.com/users/thockin/following{/other_user}","gists_url":"https://api.github.com/users/thockin/gists{/gist_id}","starred_url":"https://api.github.com/users/thockin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thockin/subscriptions","organizations_url":"https://api.github.com/users/thockin/orgs","repos_url":"https://api.github.com/users/thockin/repos","events_url":"https://api.github.com/users/thockin/events{/privacy}","received_events_url":"https://api.github.com/users/thockin/received_events","type":"User","site_admin":false},"created_at":"2015-10-23T18:27:27Z","updated_at":"2015-10-23T18:27:27Z","body":"We're certainly open to simplifications...\n\nOn Fri, Oct 23, 2015 at 11:21 AM, David Crawshaw <notifications@github.com>\nwrote:\n\n> The api package uses a Quantity type to represent MB/GB/MiB/GiB/etc\n> quantities. Right now it depends on an old version of a third-party\n> infinite-precision decimal arithmetic package.\n>\n> I believe it's possible to get the same effect with a type like:\n>\n> type Quantity struct {\n>         base Format\n>         mant int64\n>         exp  int\n> }\n>\n> type Format int\n>\n> const (\n>         Base1000 Format = iota\n>         Base1024\n> )\n>\n> ...which would remove a lot of the sharp edges from inside its\n> implementation. (And, one less dependency.) Would you accept a patch to do\n> this?\n>\n> @lavalamp <https://github.com/lavalamp>, a random googler who seems to\n> have touched this code recently\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/kubernetes/kubernetes/issues/16172>.\n>\n"}}