{"action":"closed","issue":{"url":"https://api.github.com/repos/gophercloud/gophercloud/issues/50","repository_url":"https://api.github.com/repos/gophercloud/gophercloud","labels_url":"https://api.github.com/repos/gophercloud/gophercloud/issues/50/labels{/name}","comments_url":"https://api.github.com/repos/gophercloud/gophercloud/issues/50/comments","events_url":"https://api.github.com/repos/gophercloud/gophercloud/issues/50/events","html_url":"https://github.com/gophercloud/gophercloud/issues/50","id":171085701,"number":50,"title":"Unmarshal error when copying object","user":{"login":"jtopjian","id":46959,"avatar_url":"https://avatars.githubusercontent.com/u/46959?v=3","gravatar_id":"","url":"https://api.github.com/users/jtopjian","html_url":"https://github.com/jtopjian","followers_url":"https://api.github.com/users/jtopjian/followers","following_url":"https://api.github.com/users/jtopjian/following{/other_user}","gists_url":"https://api.github.com/users/jtopjian/gists{/gist_id}","starred_url":"https://api.github.com/users/jtopjian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jtopjian/subscriptions","organizations_url":"https://api.github.com/users/jtopjian/orgs","repos_url":"https://api.github.com/users/jtopjian/repos","events_url":"https://api.github.com/users/jtopjian/events{/privacy}","received_events_url":"https://api.github.com/users/jtopjian/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/gophercloud/gophercloud/labels/bug","name":"bug","color":"fc2929"},{"url":"https://api.github.com/repos/gophercloud/gophercloud/labels/ready","name":"ready","color":"ededed"}],"state":"closed","locked":false,"assignee":{"login":"jrperritt","id":1733222,"avatar_url":"https://avatars.githubusercontent.com/u/1733222?v=3","gravatar_id":"","url":"https://api.github.com/users/jrperritt","html_url":"https://github.com/jrperritt","followers_url":"https://api.github.com/users/jrperritt/followers","following_url":"https://api.github.com/users/jrperritt/following{/other_user}","gists_url":"https://api.github.com/users/jrperritt/gists{/gist_id}","starred_url":"https://api.github.com/users/jrperritt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrperritt/subscriptions","organizations_url":"https://api.github.com/users/jrperritt/orgs","repos_url":"https://api.github.com/users/jrperritt/repos","events_url":"https://api.github.com/users/jrperritt/events{/privacy}","received_events_url":"https://api.github.com/users/jrperritt/received_events","type":"User","site_admin":false},"assignees":[{"login":"jrperritt","id":1733222,"avatar_url":"https://avatars.githubusercontent.com/u/1733222?v=3","gravatar_id":"","url":"https://api.github.com/users/jrperritt","html_url":"https://github.com/jrperritt","followers_url":"https://api.github.com/users/jrperritt/followers","following_url":"https://api.github.com/users/jrperritt/following{/other_user}","gists_url":"https://api.github.com/users/jrperritt/gists{/gist_id}","starred_url":"https://api.github.com/users/jrperritt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrperritt/subscriptions","organizations_url":"https://api.github.com/users/jrperritt/orgs","repos_url":"https://api.github.com/users/jrperritt/repos","events_url":"https://api.github.com/users/jrperritt/events{/privacy}","received_events_url":"https://api.github.com/users/jrperritt/received_events","type":"User","site_admin":false}],"milestone":null,"comments":8,"created_at":"2016-08-14T23:20:23Z","updated_at":"2016-08-31T20:31:05Z","closed_at":"2016-08-31T20:31:05Z","body":"I'm seeing the following error when trying to extract the results of a copy:\r\n\r\n```\r\njson: cannot unmarshal string into Go value of type int64\r\n```\r\n\r\nHere's the code I'm using:\r\n\r\n```go\r\ncopyResult := objects.Copy(client, containerName, objectName, copyOpts)\r\ncopyHeader, err := copyResult.Extract()\r\n```\r\n\r\nHere's what `copyResult` looks like:\r\n\r\n```\r\nobjects.CopyResult{HeaderResult:gophercloud.HeaderResult{Result:gophercloud.Result{Body:interface {}(nil), Header:http.Header{\"Last-Modified\":[]string{\"Sun, 14 Aug 2016 23:11:50 GMT\"}, \"Etag\":[]string{\"4cb9bc8724551e6c7415f1080df84869\"}, \"X-Copied-From-Account\":[]string{\"AUTH_a54442e26ad8409a905659a268197eae\"}, \"Content-Type\":[]string{\"text/html; charset=UTF-8\"}, \"X-Trans-Id\":[]string{\"tx76234fbd166a462ca6e84-0057b0fab5\"}, \"Date\":[]string{\"Sun, 14 Aug 2016 23:11:49 GMT\"}, \"Content-Length\":[]string{\"0\"}, \"X-Copied-From\":[]string{\"test-container-Jy8w56q9/test-object-chsLSwuc\"}, \"X-Copied-From-Last-Modified\":[]string{\"Sun, 14 Aug 2016 23:11:50 GMT\"}}, Err:error(nil)}}}\r\n```\r\n\r\n[ContentLength](https://github.com/gophercloud/gophercloud/blob/6dea3f17463923a8ea359d85ce2acaeb3ebb1c23/openstack/objectstorage/v1/objects/results.go#L262) is triggering the error\r\n\r\nThis is probably the same as the other unmarshal errors, but I'm not sure what to do since `CopyResult` is of type `gophercloud.HeaderResult`. Doing it incorrectly is probably going to break more things down the chain.\r\n\r\nAs well, `ContentLength` is defined as a string for the other structs. So maybe changing `int64` to `string` is the solution?"}}
{"actor":{"display_login":"jrperritt"}}