{"action":"created","issue":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-golang/issues/219","repository_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-golang","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-golang/issues/219/labels{/name}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-golang/issues/219/comments","events_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-golang/issues/219/events","html_url":"https://github.com/GoogleCloudPlatform/gcloud-golang/issues/219","id":137932373,"number":219,"title":"storage: Writer always truncates files on close","user":{"login":"toqueteos","id":699969,"avatar_url":"https://avatars.githubusercontent.com/u/699969?v=3","gravatar_id":"","url":"https://api.github.com/users/toqueteos","html_url":"https://github.com/toqueteos","followers_url":"https://api.github.com/users/toqueteos/followers","following_url":"https://api.github.com/users/toqueteos/following{/other_user}","gists_url":"https://api.github.com/users/toqueteos/gists{/gist_id}","starred_url":"https://api.github.com/users/toqueteos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/toqueteos/subscriptions","organizations_url":"https://api.github.com/users/toqueteos/orgs","repos_url":"https://api.github.com/users/toqueteos/repos","events_url":"https://api.github.com/users/toqueteos/events{/privacy}","received_events_url":"https://api.github.com/users/toqueteos/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-golang/labels/storage","name":"storage","color":"fbca04"}],"state":"open","locked":false,"assignee":{"login":"okdave","id":1091335,"avatar_url":"https://avatars.githubusercontent.com/u/1091335?v=3","gravatar_id":"","url":"https://api.github.com/users/okdave","html_url":"https://github.com/okdave","followers_url":"https://api.github.com/users/okdave/followers","following_url":"https://api.github.com/users/okdave/following{/other_user}","gists_url":"https://api.github.com/users/okdave/gists{/gist_id}","starred_url":"https://api.github.com/users/okdave/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/okdave/subscriptions","organizations_url":"https://api.github.com/users/okdave/orgs","repos_url":"https://api.github.com/users/okdave/repos","events_url":"https://api.github.com/users/okdave/events{/privacy}","received_events_url":"https://api.github.com/users/okdave/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2016-03-02T17:03:54Z","updated_at":"2016-03-04T11:30:33Z","closed_at":null,"body":"Reference: https://github.com/GoogleCloudPlatform/gcloud-golang/pull/218\r\n\r\nQuoted from [GoDoc's ObjectHandle.NewWriter](https://godoc.org/google.golang.org/cloud/storage#ObjectHandle.NewWriter):\r\n\r\n>  NewWriter returns a storage Writer that writes to the GCS object associated with this ObjectHandle. If such an object doesn't exist, it creates one. Attributes can be set on the object by modifying the returned Writer's ObjectAttrs field before the first call to Write.\r\n\r\n> It is the caller's responsibility to call Close when writing is done.\r\n\r\n> The object is not available and any previous object with the same name is not replaced on Cloud Storage until Close is called. \r\n\r\nI propose adding a brief explanation of what happens when objects do already exist as there's no way, that I'm aware of, for opening a file for writing without truncating it.\r\n\r\n/cc @bradfitz "},"comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-golang/issues/comments/192242980","html_url":"https://github.com/GoogleCloudPlatform/gcloud-golang/issues/219#issuecomment-192242980","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-golang/issues/219","id":192242980,"user":{"login":"nightlyone","id":1767118,"avatar_url":"https://avatars.githubusercontent.com/u/1767118?v=3","gravatar_id":"","url":"https://api.github.com/users/nightlyone","html_url":"https://github.com/nightlyone","followers_url":"https://api.github.com/users/nightlyone/followers","following_url":"https://api.github.com/users/nightlyone/following{/other_user}","gists_url":"https://api.github.com/users/nightlyone/gists{/gist_id}","starred_url":"https://api.github.com/users/nightlyone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nightlyone/subscriptions","organizations_url":"https://api.github.com/users/nightlyone/orgs","repos_url":"https://api.github.com/users/nightlyone/repos","events_url":"https://api.github.com/users/nightlyone/events{/privacy}","received_events_url":"https://api.github.com/users/nightlyone/received_events","type":"User","site_admin":false},"created_at":"2016-03-04T11:30:33Z","updated_at":"2016-03-04T11:30:33Z","body":"It actually is explained rather well at https://cloud.google.com/storage/docs/key-terms on bullet point \"Object immutability\" and inter-operation behavior at https://cloud.google.com/storage/docs/consistency so linking to this might suffice."}}