Skip to content

Commit d9a9e51

Browse files
committed
Deprecate functions and customization pertaining to GOPATH
Updates: gh-174
1 parent 3becce2 commit d9a9e51

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

README.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,6 @@ the following extra features to provide an improved experience:
6161

6262
All of these functions accept a prefix argument (`C-u`), causing
6363
them to skip anonymous functions.
64-
- GOPATH detection – the function `go-guess-gopath` will guess a
65-
suitable value for GOPATH, based on gb or wgo projects, Godeps and
66-
src folders for plain GOPATH workspaces. The command
67-
`go-set-project` uses the return value of `go-guess-gopath` to set
68-
the GOPATH environment variable.
69-
70-
You can either call `go-set-project` manually, or integrate it with
71-
Projectile's project switching hooks, or any other means of
72-
switching projects you may employ.
7364

7465
# Installation
7566

go-mode.el

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,8 @@ look like others."
214214
:type '(repeat function)
215215
:group 'go)
216216

217+
(make-obsolete-variable 'go-guess-gopath-functions "GOPATH has been deprecated in favour of Go modules." "1.7.0")
218+
217219
(defcustom go-confirm-playground-uploads t
218220
"Ask before uploading code to the public Go Playground.
219221
@@ -1749,8 +1751,6 @@ The following extra functions are defined:
17491751
- `go-download-play'
17501752
- `godef-describe' and `godef-jump'
17511753
- `go-coverage'
1752-
- `go-set-project'
1753-
- `go-reset-gopath'
17541754
17551755
If you want to automatically run `gofmt' before saving a file,
17561756
add the following hook to your Emacs configuration:
@@ -2760,6 +2760,7 @@ returned."
27602760

27612761
(defun go-guess-gopath (&optional buffer)
27622762
"Determine a suitable GOPATH for BUFFER, or the current buffer if BUFFER is nil."
2763+
(declare (obsolete "GOPATH has been deprecated in favour of Go modules." "1.7.0"))
27632764
(with-current-buffer (or buffer (current-buffer))
27642765
(let ((gopath (cl-some (lambda (el) (funcall el))
27652766
go-guess-gopath-functions)))
@@ -2772,6 +2773,7 @@ returned."
27722773
(defun go-plain-gopath ()
27732774
"Detect a normal GOPATH, by looking for the first `src'
27742775
directory up the directory tree."
2776+
(declare (obsolete "GOPATH has been deprecated in favour of Go modules." "1.7.0"))
27752777
(let ((d (locate-dominating-file buffer-file-name "src")))
27762778
(if d
27772779
(list d))))
@@ -2787,6 +2789,7 @@ of when Emacs was started.
27872789
This function can for example be used as a
27882790
projectile-switch-project-hook, or simply be called manually when
27892791
switching projects."
2792+
(declare (obsolete "GOPATH has been deprecated in favour of Go modules." "1.7.0"))
27902793
(interactive)
27912794
(let ((gopath (or (go-guess-gopath buffer)
27922795
(go-original-gopath))))
@@ -2795,13 +2798,15 @@ switching projects."
27952798

27962799
(defun go-reset-gopath ()
27972800
"Reset GOPATH to the value it had when Emacs started."
2801+
(declare (obsolete "GOPATH has been deprecated in favour of Go modules." "1.7.0"))
27982802
(interactive)
27992803
(let ((gopath (go-original-gopath)))
28002804
(setenv "GOPATH" gopath)
28012805
(message "Set GOPATH to %s" gopath)))
28022806

28032807
(defun go-original-gopath ()
28042808
"Return the original value of GOPATH from when Emacs was started."
2809+
(declare (obsolete "GOPATH has been deprecated in favour of Go modules." "1.7.0"))
28052810
(let ((process-environment initial-environment)) (getenv "GOPATH")))
28062811

28072812
(defun go--insert-modified-files ()

0 commit comments

Comments
 (0)