{"action":"opened","number":492,"pull_request":{"url":"https://api.github.com/repos/fatih/vim-go/pulls/492","id":40665256,"html_url":"https://github.com/fatih/vim-go/pull/492","diff_url":"https://github.com/fatih/vim-go/pull/492.diff","patch_url":"https://github.com/fatih/vim-go/pull/492.patch","issue_url":"https://api.github.com/repos/fatih/vim-go/issues/492","number":492,"state":"open","locked":false,"title":"Improve fmt-in-write by storing results in a tempfile","user":{"login":"guns","id":55776,"avatar_url":"https://avatars.githubusercontent.com/u/55776?v=3","gravatar_id":"","url":"https://api.github.com/users/guns","html_url":"https://github.com/guns","followers_url":"https://api.github.com/users/guns/followers","following_url":"https://api.github.com/users/guns/following{/other_user}","gists_url":"https://api.github.com/users/guns/gists{/gist_id}","starred_url":"https://api.github.com/users/guns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guns/subscriptions","organizations_url":"https://api.github.com/users/guns/orgs","repos_url":"https://api.github.com/users/guns/repos","events_url":"https://api.github.com/users/guns/events{/privacy}","received_events_url":"https://api.github.com/users/guns/received_events","type":"User","site_admin":false},"body":"The current implementation of `gofmt -w` is incomplete as it cannot be\r\nused from a BufWritePre hook. The command is run on a buffer's backing\r\nfile, but if the user's buffer has not been flushed to disk, gofmt\r\nprocesses the existing file and we discard the user's changes.\r\n\r\nWe can avoid this situation by using a tempfile and moving the file into\r\nplace after a successful fmt.\r\n\r\nAlso note that `let &syntax = &syntax` is the preferred way of resetting\r\nthe syntax engine for a particular buffer.","created_at":"2015-07-23T12:16:01Z","updated_at":"2015-07-23T12:16:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/fatih/vim-go/pulls/492/commits","review_comments_url":"https://api.github.com/repos/fatih/vim-go/pulls/492/comments","review_comment_url":"https://api.github.com/repos/fatih/vim-go/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fatih/vim-go/issues/492/comments","statuses_url":"https://api.github.com/repos/fatih/vim-go/statuses/4351e677523ee20cb7028b0f6a58f0b9c9b12c2f","head":{"label":"guns:fmt-in-write","ref":"fmt-in-write","sha":"4351e677523ee20cb7028b0f6a58f0b9c9b12c2f","user":{"login":"guns","id":55776,"avatar_url":"https://avatars.githubusercontent.com/u/55776?v=3","gravatar_id":"","url":"https://api.github.com/users/guns","html_url":"https://github.com/guns","followers_url":"https://api.github.com/users/guns/followers","following_url":"https://api.github.com/users/guns/following{/other_user}","gists_url":"https://api.github.com/users/guns/gists{/gist_id}","starred_url":"https://api.github.com/users/guns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guns/subscriptions","organizations_url":"https://api.github.com/users/guns/orgs","repos_url":"https://api.github.com/users/guns/repos","events_url":"https://api.github.com/users/guns/events{/privacy}","received_events_url":"https://api.github.com/users/guns/received_events","type":"User","site_admin":false},"repo":{"id":39565335,"name":"vim-go","full_name":"guns/vim-go","owner":{"login":"guns","id":55776,"avatar_url":"https://avatars.githubusercontent.com/u/55776?v=3","gravatar_id":"","url":"https://api.github.com/users/guns","html_url":"https://github.com/guns","followers_url":"https://api.github.com/users/guns/followers","following_url":"https://api.github.com/users/guns/following{/other_user}","gists_url":"https://api.github.com/users/guns/gists{/gist_id}","starred_url":"https://api.github.com/users/guns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guns/subscriptions","organizations_url":"https://api.github.com/users/guns/orgs","repos_url":"https://api.github.com/users/guns/repos","events_url":"https://api.github.com/users/guns/events{/privacy}","received_events_url":"https://api.github.com/users/guns/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/guns/vim-go","description":"Go development plugin for Vim","fork":true,"url":"https://api.github.com/repos/guns/vim-go","forks_url":"https://api.github.com/repos/guns/vim-go/forks","keys_url":"https://api.github.com/repos/guns/vim-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guns/vim-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guns/vim-go/teams","hooks_url":"https://api.github.com/repos/guns/vim-go/hooks","issue_events_url":"https://api.github.com/repos/guns/vim-go/issues/events{/number}","events_url":"https://api.github.com/repos/guns/vim-go/events","assignees_url":"https://api.github.com/repos/guns/vim-go/assignees{/user}","branches_url":"https://api.github.com/repos/guns/vim-go/branches{/branch}","tags_url":"https://api.github.com/repos/guns/vim-go/tags","blobs_url":"https://api.github.com/repos/guns/vim-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guns/vim-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guns/vim-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/guns/vim-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guns/vim-go/statuses/{sha}","languages_url":"https://api.github.com/repos/guns/vim-go/languages","stargazers_url":"https://api.github.com/repos/guns/vim-go/stargazers","contributors_url":"https://api.github.com/repos/guns/vim-go/contributors","subscribers_url":"https://api.github.com/repos/guns/vim-go/subscribers","subscription_url":"https://api.github.com/repos/guns/vim-go/subscription","commits_url":"https://api.github.com/repos/guns/vim-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/guns/vim-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/guns/vim-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/guns/vim-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/guns/vim-go/contents/{+path}","compare_url":"https://api.github.com/repos/guns/vim-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guns/vim-go/merges","archive_url":"https://api.github.com/repos/guns/vim-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guns/vim-go/downloads","issues_url":"https://api.github.com/repos/guns/vim-go/issues{/number}","pulls_url":"https://api.github.com/repos/guns/vim-go/pulls{/number}","milestones_url":"https://api.github.com/repos/guns/vim-go/milestones{/number}","notifications_url":"https://api.github.com/repos/guns/vim-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guns/vim-go/labels{/name}","releases_url":"https://api.github.com/repos/guns/vim-go/releases{/id}","created_at":"2015-07-23T12:10:58Z","updated_at":"2015-07-23T12:10:59Z","pushed_at":"2015-07-23T12:15:48Z","git_url":"git://github.com/guns/vim-go.git","ssh_url":"git@github.com:guns/vim-go.git","clone_url":"https://github.com/guns/vim-go.git","svn_url":"https://github.com/guns/vim-go","homepage":"","size":2742,"stargazers_count":0,"watchers_count":0,"language":"VimL","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":"fatih:fmt-in-write","ref":"fmt-in-write","sha":"01578fd8632870f8285266b93c1e219df19c4002","user":{"login":"fatih","id":438920,"avatar_url":"https://avatars.githubusercontent.com/u/438920?v=3","gravatar_id":"","url":"https://api.github.com/users/fatih","html_url":"https://github.com/fatih","followers_url":"https://api.github.com/users/fatih/followers","following_url":"https://api.github.com/users/fatih/following{/other_user}","gists_url":"https://api.github.com/users/fatih/gists{/gist_id}","starred_url":"https://api.github.com/users/fatih/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fatih/subscriptions","organizations_url":"https://api.github.com/users/fatih/orgs","repos_url":"https://api.github.com/users/fatih/repos","events_url":"https://api.github.com/users/fatih/events{/privacy}","received_events_url":"https://api.github.com/users/fatih/received_events","type":"User","site_admin":false},"repo":{"id":18062944,"name":"vim-go","full_name":"fatih/vim-go","owner":{"login":"fatih","id":438920,"avatar_url":"https://avatars.githubusercontent.com/u/438920?v=3","gravatar_id":"","url":"https://api.github.com/users/fatih","html_url":"https://github.com/fatih","followers_url":"https://api.github.com/users/fatih/followers","following_url":"https://api.github.com/users/fatih/following{/other_user}","gists_url":"https://api.github.com/users/fatih/gists{/gist_id}","starred_url":"https://api.github.com/users/fatih/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fatih/subscriptions","organizations_url":"https://api.github.com/users/fatih/orgs","repos_url":"https://api.github.com/users/fatih/repos","events_url":"https://api.github.com/users/fatih/events{/privacy}","received_events_url":"https://api.github.com/users/fatih/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fatih/vim-go","description":"Go development plugin for Vim","fork":false,"url":"https://api.github.com/repos/fatih/vim-go","forks_url":"https://api.github.com/repos/fatih/vim-go/forks","keys_url":"https://api.github.com/repos/fatih/vim-go/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fatih/vim-go/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fatih/vim-go/teams","hooks_url":"https://api.github.com/repos/fatih/vim-go/hooks","issue_events_url":"https://api.github.com/repos/fatih/vim-go/issues/events{/number}","events_url":"https://api.github.com/repos/fatih/vim-go/events","assignees_url":"https://api.github.com/repos/fatih/vim-go/assignees{/user}","branches_url":"https://api.github.com/repos/fatih/vim-go/branches{/branch}","tags_url":"https://api.github.com/repos/fatih/vim-go/tags","blobs_url":"https://api.github.com/repos/fatih/vim-go/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fatih/vim-go/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fatih/vim-go/git/refs{/sha}","trees_url":"https://api.github.com/repos/fatih/vim-go/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fatih/vim-go/statuses/{sha}","languages_url":"https://api.github.com/repos/fatih/vim-go/languages","stargazers_url":"https://api.github.com/repos/fatih/vim-go/stargazers","contributors_url":"https://api.github.com/repos/fatih/vim-go/contributors","subscribers_url":"https://api.github.com/repos/fatih/vim-go/subscribers","subscription_url":"https://api.github.com/repos/fatih/vim-go/subscription","commits_url":"https://api.github.com/repos/fatih/vim-go/commits{/sha}","git_commits_url":"https://api.github.com/repos/fatih/vim-go/git/commits{/sha}","comments_url":"https://api.github.com/repos/fatih/vim-go/comments{/number}","issue_comment_url":"https://api.github.com/repos/fatih/vim-go/issues/comments{/number}","contents_url":"https://api.github.com/repos/fatih/vim-go/contents/{+path}","compare_url":"https://api.github.com/repos/fatih/vim-go/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fatih/vim-go/merges","archive_url":"https://api.github.com/repos/fatih/vim-go/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fatih/vim-go/downloads","issues_url":"https://api.github.com/repos/fatih/vim-go/issues{/number}","pulls_url":"https://api.github.com/repos/fatih/vim-go/pulls{/number}","milestones_url":"https://api.github.com/repos/fatih/vim-go/milestones{/number}","notifications_url":"https://api.github.com/repos/fatih/vim-go/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fatih/vim-go/labels{/name}","releases_url":"https://api.github.com/repos/fatih/vim-go/releases{/id}","created_at":"2014-03-24T13:12:26Z","updated_at":"2015-07-22T15:01:52Z","pushed_at":"2015-07-23T12:16:01Z","git_url":"git://github.com/fatih/vim-go.git","ssh_url":"git@github.com:fatih/vim-go.git","clone_url":"https://github.com/fatih/vim-go.git","svn_url":"https://github.com/fatih/vim-go","homepage":"","size":2742,"stargazers_count":2791,"watchers_count":2791,"language":"VimL","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":243,"mirror_url":null,"open_issues_count":18,"forks":243,"open_issues":18,"watchers":2791,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fatih/vim-go/pulls/492"},"html":{"href":"https://github.com/fatih/vim-go/pull/492"},"issue":{"href":"https://api.github.com/repos/fatih/vim-go/issues/492"},"comments":{"href":"https://api.github.com/repos/fatih/vim-go/issues/492/comments"},"review_comments":{"href":"https://api.github.com/repos/fatih/vim-go/pulls/492/comments"},"review_comment":{"href":"https://api.github.com/repos/fatih/vim-go/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fatih/vim-go/pulls/492/commits"},"statuses":{"href":"https://api.github.com/repos/fatih/vim-go/statuses/4351e677523ee20cb7028b0f6a58f0b9c9b12c2f"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":11,"deletions":4,"changed_files":1}}