From 9fa172b4c95499b4620ac5f3a7d5add9fc854afa Mon Sep 17 00:00:00 2001 From: Alvaro Leiva M Date: Wed, 27 Nov 2019 20:55:54 -0300 Subject: [PATCH] fixes #41 and others --- Default.sublime-settings | 2 +- README.md | 8 -------- goGuru.py | 6 +++++- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/Default.sublime-settings b/Default.sublime-settings index 1f4649c..781acfa 100644 --- a/Default.sublime-settings +++ b/Default.sublime-settings @@ -1,5 +1,5 @@ { - "goguru_version" : "0.1.21", // DO NOT MODIFY + "goguru_version" : "0.1.22", // DO NOT MODIFY // Please do not edit this file, instead use the user config. // use golangconfig, if false then shellenv will be used to get golang environment variables diff --git a/README.md b/README.md index fb1775d..c9e3433 100644 --- a/README.md +++ b/README.md @@ -155,14 +155,6 @@ GoGuru relies on the guru tool. You must install it in order for GoGuru to work. `go get -u golang.org/x/tools/cmd/guru` -About Go Guru ---------------- - -- [User Manual](https://docs.google.com/document/d/1SLk36YRjjMgKqe490mSRzOPYEDe0Y_WQNRv-EiFYUyw/view#) -- [Design Document](https://docs.google.com/a/canonical.com/document/d/1WmMHBUjQiuy15JfEnT8YBROQmEv-7K6bV-Y_K53oi5Y/edit#heading=h.m6dk5m56ri4e) -- [GoDoc](https://godoc.org/golang.org/x/tools/cmd/oracle) - - Copyright, License & Contributors ================================= diff --git a/goGuru.py b/goGuru.py index c2faba0..86a43ab 100644 --- a/goGuru.py +++ b/goGuru.py @@ -358,7 +358,11 @@ def guru(self, end_offset, begin_offset=None, mode="describe", callback=None): file_path = self.view.file_name() if useCurrentPackage: - GOPATH = os.path.realpath(cmd_env["GOPATH"]) + try: + GOPATH = os.path.realpath(cmd_env["GOPATH"]) + except: + log("WARNING: using default GOPATH since it isn't declared ($HOME/go)") + GOPATH = os.path.expanduser("~/go") debug("GOPATH", GOPATH) local_package = get_local_package(GOPATH, file_path)