{"action":"opened","number":8,"pull_request":{"url":"https://api.github.com/repos/docker/go-units/pulls/8","id":56316620,"html_url":"https://github.com/docker/go-units/pull/8","diff_url":"https://github.com/docker/go-units/pull/8.diff","patch_url":"https://github.com/docker/go-units/pull/8.patch","issue_url":"https://api.github.com/repos/docker/go-units/issues/8","number":8,"state":"open","locked":false,"title":"Enhance FromHumanSize to parse float64 string","user":{"login":"WeiZhang555","id":1203611,"avatar_url":"https://avatars.githubusercontent.com/u/1203611?v=3","gravatar_id":"","url":"https://api.github.com/users/WeiZhang555","html_url":"https://github.com/WeiZhang555","followers_url":"https://api.github.com/users/WeiZhang555/followers","following_url":"https://api.github.com/users/WeiZhang555/following{/other_user}","gists_url":"https://api.github.com/users/WeiZhang555/gists{/gist_id}","starred_url":"https://api.github.com/users/WeiZhang555/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WeiZhang555/subscriptions","organizations_url":"https://api.github.com/users/WeiZhang555/orgs","repos_url":"https://api.github.com/users/WeiZhang555/repos","events_url":"https://api.github.com/users/WeiZhang555/events{/privacy}","received_events_url":"https://api.github.com/users/WeiZhang555/received_events","type":"User","site_admin":false},"body":"Currently FromHumanSize can only interpret format of '32kB', this commit\r\nenhance it to interpret flat64 string with blank such as '32.3 kB'.\r\n\r\nSigned-off-by: Zhang Wei <zhangwei555@huawei.com>\r\n\r\nI need this function for doing `docker stats` integration test, because `docker stats` use `HumanSize` to  format byte into human readable string, now I need to revert the string to byte number. But `FromHumanSize` can't interpret `23.3 kB`, so this commit add float64 support.\r\n\r\nI also add the blank support but it doesn't matter if you don't like it.\r\n\r\nI think you may have special considerations for only supporting int64, but I'm not sure what's it. \r\nI can make relevant change based on your ideas. \r\nPing @calavera ","created_at":"2016-01-18T09:11:38Z","updated_at":"2016-01-18T09:11:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/docker/go-units/pulls/8/commits","review_comments_url":"https://api.github.com/repos/docker/go-units/pulls/8/comments","review_comment_url":"https://api.github.com/repos/docker/go-units/pulls/comments{/number}","comments_url":"https://api.github.com/repos/docker/go-units/issues/8/comments","statuses_url":"https://api.github.com/repos/docker/go-units/statuses/930978e70f550b7da307fb93d4b70c8968a8fde6","head":{"label":"WeiZhang555:from-human-size","ref":"from-human-size","sha":"930978e70f550b7da307fb93d4b70c8968a8fde6","user":{"login":"WeiZhang555","id":1203611,"avatar_url":"https://avatars.githubusercontent.com/u/1203611?v=3","gravatar_id":"","url":"https://api.github.com/users/WeiZhang555","html_url":"https://github.com/WeiZhang555","followers_url":"https://api.github.com/users/WeiZhang555/followers","following_url":"https://api.github.com/users/WeiZhang555/following{/other_user}","gists_url":"https://api.github.com/users/WeiZhang555/gists{/gist_id}","starred_url":"https://api.github.com/users/WeiZhang555/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WeiZhang555/subscriptions","organizations_url":"https://api.github.com/users/WeiZhang555/orgs","repos_url":"https://api.github.com/users/WeiZhang555/repos","events_url":"https://api.github.com/users/WeiZhang555/events{/privacy}","received_events_url":"https://api.github.com/users/WeiZhang555/received_events","type":"User","site_admin":false},"repo":{"id":49314910,"name":"go-units","full_name":"WeiZhang555/go-units","owner":{"login":"WeiZhang555","id":1203611,"avatar_url":"https://avatars.githubusercontent.com/u/1203611?v=3","gravatar_id":"","url":"https://api.github.com/users/WeiZhang555","html_url":"https://github.com/WeiZhang555","followers_url":"https://api.github.com/users/WeiZhang555/followers","following_url":"https://api.github.com/users/WeiZhang555/following{/other_user}","gists_url":"https://api.github.com/users/WeiZhang555/gists{/gist_id}","starred_url":"https://api.github.com/users/WeiZhang555/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WeiZhang555/subscriptions","organizations_url":"https://api.github.com/users/WeiZhang555/orgs","repos_url":"https://api.github.com/users/WeiZhang555/repos","events_url":"https://api.github.com/users/WeiZhang555/events{/privacy}","received_events_url":"https://api.github.com/users/WeiZhang555/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/WeiZhang555/go-units","description":"Parse and print size and time units in human-readable format","fork":true,"url":"https://api.github.com/repos/WeiZhang555/go-units","forks_url":"https://api.github.com/repos/WeiZhang555/go-units/forks","keys_url":"https://api.github.com/repos/WeiZhang555/go-units/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WeiZhang555/go-units/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WeiZhang555/go-units/teams","hooks_url":"https://api.github.com/repos/WeiZhang555/go-units/hooks","issue_events_url":"https://api.github.com/repos/WeiZhang555/go-units/issues/events{/number}","events_url":"https://api.github.com/repos/WeiZhang555/go-units/events","assignees_url":"https://api.github.com/repos/WeiZhang555/go-units/assignees{/user}","branches_url":"https://api.github.com/repos/WeiZhang555/go-units/branches{/branch}","tags_url":"https://api.github.com/repos/WeiZhang555/go-units/tags","blobs_url":"https://api.github.com/repos/WeiZhang555/go-units/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WeiZhang555/go-units/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WeiZhang555/go-units/git/refs{/sha}","trees_url":"https://api.github.com/repos/WeiZhang555/go-units/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WeiZhang555/go-units/statuses/{sha}","languages_url":"https://api.github.com/repos/WeiZhang555/go-units/languages","stargazers_url":"https://api.github.com/repos/WeiZhang555/go-units/stargazers","contributors_url":"https://api.github.com/repos/WeiZhang555/go-units/contributors","subscribers_url":"https://api.github.com/repos/WeiZhang555/go-units/subscribers","subscription_url":"https://api.github.com/repos/WeiZhang555/go-units/subscription","commits_url":"https://api.github.com/repos/WeiZhang555/go-units/commits{/sha}","git_commits_url":"https://api.github.com/repos/WeiZhang555/go-units/git/commits{/sha}","comments_url":"https://api.github.com/repos/WeiZhang555/go-units/comments{/number}","issue_comment_url":"https://api.github.com/repos/WeiZhang555/go-units/issues/comments{/number}","contents_url":"https://api.github.com/repos/WeiZhang555/go-units/contents/{+path}","compare_url":"https://api.github.com/repos/WeiZhang555/go-units/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WeiZhang555/go-units/merges","archive_url":"https://api.github.com/repos/WeiZhang555/go-units/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WeiZhang555/go-units/downloads","issues_url":"https://api.github.com/repos/WeiZhang555/go-units/issues{/number}","pulls_url":"https://api.github.com/repos/WeiZhang555/go-units/pulls{/number}","milestones_url":"https://api.github.com/repos/WeiZhang555/go-units/milestones{/number}","notifications_url":"https://api.github.com/repos/WeiZhang555/go-units/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WeiZhang555/go-units/labels{/name}","releases_url":"https://api.github.com/repos/WeiZhang555/go-units/releases{/id}","created_at":"2016-01-09T07:16:10Z","updated_at":"2016-01-09T07:16:11Z","pushed_at":"2016-01-18T09:06:35Z","git_url":"git://github.com/WeiZhang555/go-units.git","ssh_url":"git@github.com:WeiZhang555/go-units.git","clone_url":"https://github.com/WeiZhang555/go-units.git","svn_url":"https://github.com/WeiZhang555/go-units","homepage":"https://godoc.org/github.com/docker/go-units","size":45,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"docker:master","ref":"master","sha":"0bbddae09c5a5419a8c6dcdd7ff90da3d450393b","user":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"repo":{"id":48010408,"name":"go-units","full_name":"docker/go-units","owner":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/docker/go-units","description":"Parse and print size and time units in human-readable format","fork":false,"url":"https://api.github.com/repos/docker/go-units","forks_url":"https://api.github.com/repos/docker/go-units/forks","keys_url":"https://api.github.com/repos/docker/go-units/keys{/key_id}","collaborators_url":"https://api.github.com/repos/docker/go-units/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/docker/go-units/teams","hooks_url":"https://api.github.com/repos/docker/go-units/hooks","issue_events_url":"https://api.github.com/repos/docker/go-units/issues/events{/number}","events_url":"https://api.github.com/repos/docker/go-units/events","assignees_url":"https://api.github.com/repos/docker/go-units/assignees{/user}","branches_url":"https://api.github.com/repos/docker/go-units/branches{/branch}","tags_url":"https://api.github.com/repos/docker/go-units/tags","blobs_url":"https://api.github.com/repos/docker/go-units/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/docker/go-units/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/docker/go-units/git/refs{/sha}","trees_url":"https://api.github.com/repos/docker/go-units/git/trees{/sha}","statuses_url":"https://api.github.com/repos/docker/go-units/statuses/{sha}","languages_url":"https://api.github.com/repos/docker/go-units/languages","stargazers_url":"https://api.github.com/repos/docker/go-units/stargazers","contributors_url":"https://api.github.com/repos/docker/go-units/contributors","subscribers_url":"https://api.github.com/repos/docker/go-units/subscribers","subscription_url":"https://api.github.com/repos/docker/go-units/subscription","commits_url":"https://api.github.com/repos/docker/go-units/commits{/sha}","git_commits_url":"https://api.github.com/repos/docker/go-units/git/commits{/sha}","comments_url":"https://api.github.com/repos/docker/go-units/comments{/number}","issue_comment_url":"https://api.github.com/repos/docker/go-units/issues/comments{/number}","contents_url":"https://api.github.com/repos/docker/go-units/contents/{+path}","compare_url":"https://api.github.com/repos/docker/go-units/compare/{base}...{head}","merges_url":"https://api.github.com/repos/docker/go-units/merges","archive_url":"https://api.github.com/repos/docker/go-units/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/docker/go-units/downloads","issues_url":"https://api.github.com/repos/docker/go-units/issues{/number}","pulls_url":"https://api.github.com/repos/docker/go-units/pulls{/number}","milestones_url":"https://api.github.com/repos/docker/go-units/milestones{/number}","notifications_url":"https://api.github.com/repos/docker/go-units/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/docker/go-units/labels{/name}","releases_url":"https://api.github.com/repos/docker/go-units/releases{/id}","created_at":"2015-12-15T00:47:50Z","updated_at":"2016-01-16T11:28:43Z","pushed_at":"2016-01-09T07:35:19Z","git_url":"git://github.com/docker/go-units.git","ssh_url":"git@github.com:docker/go-units.git","clone_url":"https://github.com/docker/go-units.git","svn_url":"https://github.com/docker/go-units","homepage":"https://godoc.org/github.com/docker/go-units","size":46,"stargazers_count":13,"watchers_count":13,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":5,"mirror_url":null,"open_issues_count":1,"forks":5,"open_issues":1,"watchers":13,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/go-units/pulls/8"},"html":{"href":"https://github.com/docker/go-units/pull/8"},"issue":{"href":"https://api.github.com/repos/docker/go-units/issues/8"},"comments":{"href":"https://api.github.com/repos/docker/go-units/issues/8/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/go-units/pulls/8/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/go-units/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/docker/go-units/pulls/8/commits"},"statuses":{"href":"https://api.github.com/repos/docker/go-units/statuses/930978e70f550b7da307fb93d4b70c8968a8fde6"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":15,"deletions":12,"changed_files":2}}