 (defun go-guru-describe ()
   "Describe the selected syntax, its kind, type and methods."
   (interactive)
-  (go-guru--run "describe"))
+  (go-guru--start "describe"))
 
 ;;;###autoload
 (defun go-guru-pointsto ()
   "Show what the selected expression points to."
   (interactive)
-  (go-guru--run "pointsto" t))
+  (go-guru--set-scope-if-empty)
+  (go-guru--start "pointsto"))
 
 ;;;###autoload
 (defun go-guru-implements ()
   "Describe the 'implements' relation for types in the package
 containing the current point."
   (interactive)
-  (go-guru--run "implements"))
+  (go-guru--start "implements"))
 
 ;;;###autoload
 (defun go-guru-freevars ()
   "Enumerate the free variables of the current selection."
   (interactive)
-  (go-guru--run "freevars"))
+  (go-guru--start "freevars"))
 
 ;;;###autoload
 (defun go-guru-peers ()
   "Enumerate the set of possible corresponding sends/receives for
 this channel receive/send operation."
   (interactive)
-  (go-guru--run "peers" t))
+  (go-guru--set-scope-if-empty)
+  (go-guru--start "peers"))
 
 ;;;###autoload
 (defun go-guru-referrers ()
   "Enumerate all references to the object denoted by the selected
 identifier."
   (interactive)
-  (go-guru--run "referrers"))
+  (go-guru--start "referrers"))
 
 ;;;###autoload
 (defun go-guru-whicherrs ()
   "Show globals, constants and types to which the selected
 expression (of type 'error') may refer."
   (interactive)
-  (go-guru--run "whicherrs" t))
+  (go-guru--set-scope-if-empty)
+  (go-guru--start "whicherrs"))
 
 (defun go-guru-what ()
   "Run a 'what' query and return the parsed JSON response as an
 association list."
-  (with-current-buffer (go-guru--exec "what" nil '("-json") t)
-    (goto-char (point-min))
-    (json-read)))
+  (go-guru--json "what"))
 
 (defun go-guru--hl-symbols (posn face id)
   "Highlight the symbols at the positions POSN by creating

(defun go-guru-callees ()
  "Show possible callees of the function call at the current point."
  (interactive)
  (go-guru--run "callees" t))

;;;###autoload
(defun go-guru-callers ()
  "Show the set of callers of the function containing the current point."
  (interactive)
  (go-guru--run "callers" t))

;;;###autoload
(defun go-guru-callstack ()
  "Show an arbitrary path from a root of the call graph to the
function containing the current point."
  (interactive)
  (go-guru--run "callstack" t))

;;;###autoload
(defun go-guru-definition ()
  "Jump to the definition of the selected identifier."
  (interactive)
  (let* ((res (with-current-buffer (go-guru--exec "definition" nil '("-json"))
		(goto-char (point-min))
		(json-read)))
	 (desc (cdr (assoc 'desc res))))
    (push-mark)
    (ring-insert find-tag-marker-ring (point-marker))

If BUFFER, return the number of characters in that buffer instead."
  (with-current-buffer (or buffer (current-buffer))
    (string-bytes (buffer-substring (point-min)
				    (point-max)))))

(defun go-guru--goto-byte (offset)
  "Go to the OFFSETth byte in the buffer."
