Created
February 22, 2017 21:54
-
-
Save sideshowcoder/0d37c53bbf1d62299600bb723cc20af0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun coder/go-guru-set-current-package-as-main () | |
"GoGuru requires the scope to be set to a go package which | |
contains a main, this function will make the current package the | |
active go guru scope, assuming it contains a main" | |
(interactive) | |
(let* ((filename (buffer-file-name)) | |
(gopath-src-path (concat (file-name-as-directory (go-guess-gopath)) "src")) | |
(relative-package-path (directory-file-name (file-name-directory (file-relative-name filename gopath-src-path))))) | |
(setq go-guru-scope relative-package-path))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment