Function: go-test-current-coverage

go-test-current-coverage is an interactive and natively compiled function defined in gotest.el.

Signature

(go-test-current-coverage)

Documentation

Launch go test coverage on the current project.

Key Bindings

This command is not in any keymaps.

Source Code

;; Defined in /nix/store/y8iliarhkh17m4iiwcy1hbi78r7b5489-emacs-packages-deps/share/emacs/site-lisp/elpa/gotest-20230221.945/gotest.el
;; Coverage
;; -------------


;;;###autoload
(defun go-test-current-coverage ()
  "Launch go test coverage on the current project."
  (interactive)
  (if (go-test--is-gb-project)
      (let* ((package (go-test--gb-find-package))
             (root-dir (go-test--get-root-directory))
             (gopath (s-concat "env GOPATH=" root-dir ":" root-dir "vendor")))
        (go-test--go-test (s-concat "-cover " package) gopath))
    (let ((args (s-concat
                 "--coverprofile="
                 (expand-file-name
                  (read-file-name "Coverage file" nil "cover.out")) " ./.")))
      (go-test--go-test args))))