{"action":"created","issue":{"url":"https://api.github.com/repos/nsf/gocode/issues/377","repository_url":"https://api.github.com/repos/nsf/gocode","labels_url":"https://api.github.com/repos/nsf/gocode/issues/377/labels{/name}","comments_url":"https://api.github.com/repos/nsf/gocode/issues/377/comments","events_url":"https://api.github.com/repos/nsf/gocode/issues/377/events","html_url":"https://github.com/nsf/gocode/issues/377","id":174937462,"number":377,"title":"Can I use emacs with company-mode and company-go to complete Go's standard library function names?","user":{"login":"eddeyang","id":39968,"avatar_url":"https://avatars.githubusercontent.com/u/39968?v=3","gravatar_id":"","url":"https://api.github.com/users/eddeyang","html_url":"https://github.com/eddeyang","followers_url":"https://api.github.com/users/eddeyang/followers","following_url":"https://api.github.com/users/eddeyang/following{/other_user}","gists_url":"https://api.github.com/users/eddeyang/gists{/gist_id}","starred_url":"https://api.github.com/users/eddeyang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eddeyang/subscriptions","organizations_url":"https://api.github.com/users/eddeyang/orgs","repos_url":"https://api.github.com/users/eddeyang/repos","events_url":"https://api.github.com/users/eddeyang/events{/privacy}","received_events_url":"https://api.github.com/users/eddeyang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-04T08:18:07Z","updated_at":"2016-09-04T08:27:05Z","closed_at":null,"body":"Below is my emacs init file that relates to Go. I'm trying to use company mode to auto completes Go.\r\n\r\n    ;;===================================================\r\n    ; Golang related configuration\r\n    ;;===================================================\r\n    (defun my-go-mode-hook ()\r\n      ; Add go-guru\r\n      (require 'go-guru)\r\n    \r\n      (require 'company)\r\n      (require 'company-go)\r\n    \r\n      ; Use goimports instead of go-fmt\r\n      (setq gofmt-command \"goimports\")\r\n      ; Call Gofmt before saving\r\n      (add-hook 'before-save-hook 'gofmt-before-save)\r\n      ; Customize compile command to run go build\r\n      (if (not (string-match \"go\" compile-command))\r\n          (set (make-local-variable 'compile-command)\r\n               ;\"go build -v && go test -v && go vet\"))\r\n               \"go run\"))\r\n      ; Godef jump key binding\r\n      (local-set-key (kbd \"M-.\") 'godef-jump))\r\n    (add-hook 'go-mode-hook 'my-go-mode-hook)\r\n    ; Highlight identifiers in Golang by default\r\n    (add-hook 'go-mode-hook #'go-guru-hl-identifier-mode)\r\n\r\nHowever, it seems that the company mode can only completes words that have been used in the buffer. See below screen shot.\r\n\r\n[![enter image description here][1]][1]\r\n\r\nWhat I want is to complete Go's builtin functions, like `fmt.Fprintln`. It seems company mode can't do that. See below screen shot.\r\n\r\n[![enter image description here][2]][2]\r\n\r\nI want to confirm, is it true? Can emacs auto completes Go's builtin functions? Are there any example emacs init files that I can use as a reference? Thanks in advance.\r\n\r\n  [1]: http://i.stack.imgur.com/fGVFe.png\r\n  [2]: http://i.stack.imgur.com/IwESJ.png"},"comment":{"url":"https://api.github.com/repos/nsf/gocode/issues/comments/244590333","html_url":"https://github.com/nsf/gocode/issues/377#issuecomment-244590333","issue_url":"https://api.github.com/repos/nsf/gocode/issues/377","id":244590333,"user":{"login":"syohex","id":554281,"avatar_url":"https://avatars.githubusercontent.com/u/554281?v=3","gravatar_id":"","url":"https://api.github.com/users/syohex","html_url":"https://github.com/syohex","followers_url":"https://api.github.com/users/syohex/followers","following_url":"https://api.github.com/users/syohex/following{/other_user}","gists_url":"https://api.github.com/users/syohex/gists{/gist_id}","starred_url":"https://api.github.com/users/syohex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/syohex/subscriptions","organizations_url":"https://api.github.com/users/syohex/orgs","repos_url":"https://api.github.com/users/syohex/repos","events_url":"https://api.github.com/users/syohex/events{/privacy}","received_events_url":"https://api.github.com/users/syohex/received_events","type":"User","site_admin":false},"created_at":"2016-09-04T08:27:05Z","updated_at":"2016-09-04T08:27:05Z","body":"You need to set `company-backends`. Sample is [here](https://github.com/nsf/gocode/tree/master/emacs-company#only-use-company-mode-with-company-go-in-go-mode)"}}
{"actor":{"display_login":"syohex"}}