<commit_before>--- a/src/cmd/goinstall/main.go
+++ b/src/cmd/goinstall/main.go
@@ -75,6 +75,14 @@ func main() {
 		os.Exit(1)
 	}
 
+	if os.Getuid() != 0 && os.Getenv("GOPATH") == "" {
+		fmt.Fprintf(os.Stderr, "%s: set $GOPATH to the directory you want packages installed to if you get permission denied error\n", argv0)
+	}
+
+	if root != defaultRoot.path {
+		logfile = filepath.Join(defaultRoot.path, "goinstall.log")
+	}
+
 	// special case - "unsafe" is already installed
 	visit["unsafe"] = done<commit_msg>Don't care about install.log<commit_after>--- a/src/cmd/goinstall/main.go
+++ b/src/cmd/goinstall/main.go
@@ -75,6 +75,10 @@ func main() {
 		os.Exit(1)
 	}
 
+	if os.Getuid() != 0 && os.Getenv("GOPATH") == "" {
+		fmt.Fprintf(os.Stderr, "%s: set $GOPATH to the directory you want packages installed to if you get permission denied error\n", argv0)
+	}
+
 	// special case - "unsafe" is already installed
 	visit["unsafe"] = done
{'fraction_non_alphanumeric': 0.18663838812301167, 'fraction_numerical': 0.021208907741251327, 'mean_word_length': 3.5825242718446604, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1788064', 'n_tokens_mistral': 384, 'n_tokens_neox': 358, 'n_words': 86}