     (looking-at "\\<func(")))
 
 (defun go-guess-gopath (&optional buffer)
-  "Determine a suitable GOPATH for BUFFER, or the current buffer if BUFFER is nil.
-
-This function supports gb-based projects as well as Godep, in
-addition to ordinary uses of GOPATH."
+  "Determine a suitable GOPATH for BUFFER, or the current buffer if BUFFER is nil."
   (with-current-buffer (or buffer (current-buffer))
     (let ((gopath (cl-some (lambda (el) (funcall el))
                            go-guess-gopath-functions)))

  :package-version '(go-mode . 1.4.0)
  :group 'go)

(defcustom go-guess-gopath-functions (list #'go-godep-gopath
                                           #'go-wgo-gopath
                                           #'go-gb-gopath
                                           #'go-plain-gopath)
  "Functions to call in sequence to detect a project's GOPATH.

The functions in this list will be called one after another,
until a function returns non-nil.  The order of the functions in
this list is important, as some project layouts may superficially
look like others.  For example, a subset of wgo projects look like
gb projects.  That's why we need to detect wgo first, to avoid
mis-identifying them as gb projects."
  :type '(repeat function)
  :group 'go)


  (let ((d (locate-dominating-file buffer-file-name "src")))
    (if d
        (list d))))

(defun go-set-project (&optional buffer)
  "Set GOPATH based on `go-guess-gopath' for BUFFER, or the current buffer if BUFFER is nil.
