Emacs: Remove the -cover test flag in Go since it shifts line numbers

master
Pierre Neidhardt 2016-11-23 12:20:03 +05:30
parent 9be2f57057
commit d2d1ab3c82
1 changed files with 4 additions and 2 deletions

View File

@ -11,12 +11,14 @@ If `compile-command' is not \"go build\":
- go test: file is in GOPATH and is a test file.
- go build: file is not in GOPATH.
If `compile-command' is \"go build\":
- go run <buffer-file-name>."
- go run <buffer-file-name>.
Note that the -cover test flag is left out since it shifts line numbers."
(interactive)
(set (make-local-variable 'compile-command)
(if (string= compile-command "go build")
(concat "go run " (shell-quote-argument buffer-file-name))
(if (go-buffer-in-gopath-p) (if (string-match "_test.[gG][oO]$" buffer-file-name) "go test -cover -v" "go install") "go build")))
(if (go-buffer-in-gopath-p) (if (string-match "_test.[gG][oO]$" buffer-file-name) "go test -v" "go install") "go build")))
(message "Set `compile-command' to `%s'" compile-command))
(defun go-buffer-in-gopath-p ()