File: 0004-heapview.patch

package info (click to toggle)
golang-golang-x-tools 1%3A0.0~git20190125.d66bd3c%2Bds-4
  • links: PTS, VCS
  • area: main
  • in suites: buster, buster-backports
  • size: 8,912 kB
  • sloc: asm: 1,394; yacc: 155; makefile: 109; sh: 108; ansic: 17; xml: 11
file content (43 lines) | stat: -rw-r--r-- 1,643 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
Index: golang-go.tools/cmd/heapview/main.go
===================================================================
--- golang-go.tools.orig/cmd/heapview/main.go
+++ golang-go.tools/cmd/heapview/main.go
@@ -11,7 +11,6 @@ import (
 	"io"
 	"log"
 	"net/http"
-	"os"
 	"path/filepath"
 )
 
@@ -34,12 +33,7 @@ var index = `<!DOCTYPE html>
 `
 
 func toolsDir() string {
-	gopath := os.Getenv("GOPATH")
-	if gopath == "" {
-		log.Println("error: GOPATH not set. Can't find client files")
-		os.Exit(1)
-	}
-	return filepath.Join(filepath.SplitList(gopath)[0], "/src/golang.org/x/tools")
+	return "/usr/share/gocode/src/golang.org/x/tools"
 }
 
 var parseFlags = func() {
@@ -53,13 +47,13 @@ var addHandlers = func() {
 
 	// Serve typescript.js and moduleloader.js for development.
 	http.HandleFunc("/js/typescript.js", func(w http.ResponseWriter, r *http.Request) {
-		http.ServeFile(w, r, filepath.Join(toolsDir(), "third_party/typescript/typescript.js"))
+		http.ServeFile(w, r, "/usr/lib/nodejs/typescript/typescript.js")
 	})
 	http.HandleFunc("/js/moduleloader.js", func(w http.ResponseWriter, r *http.Request) {
-		http.ServeFile(w, r, filepath.Join(toolsDir(), "third_party/moduleloader/moduleloader.js"))
+		http.ServeFile(w, r, "/usr/lib/javascript/es-module-loader-0.17/es6-module-loader.js")
 	})
 	http.HandleFunc("/js/customelements.js", func(w http.ResponseWriter, r *http.Request) {
-		http.ServeFile(w, r, filepath.Join(toolsDir(), "third_party/webcomponents/customelements.js"))
+		http.ServeFile(w, r, "/usr/lib/javascript/webcomponentsjs-custom-element-v0/CustomElements.js")
 	})
 
 	// Serve index.html using html string above.