Repository: goplus/gop
Pull request #1052 (2021-12-11 01:38:45)

gox v1.8.7


Patch:
diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml
index ea06a35a..5052546c 100644
--- a/.github/workflows/go.yml
+++ b/.github/workflows/go.yml
@@ -21,9 +21,6 @@ jobs:
       with:
         go-version: ${{ matrix.go-version }}
 
-    - name: Test Go+ installer
-      run: go test -v cmd/make_test.go
-
     - name: Compile gop and related tools
       run: go install ./...
 
diff --git a/README.md b/README.md
index d7afc11c..5fe28f26 100644
--- a/README.md
+++ b/README.md
@@ -87,10 +87,10 @@ It's for Go, and it's also for Go+.
 
 ## Playground
 
-Go+ Playground based on Docker:
+Go+ Playground based on Docker (recommended):
 * https://play.goplus.org/
 
-Go+ Playground based on GopherJS:
+Go+ Playground based on GopherJS (currently only available in v0.7.x):
 * https://jsplay.goplus.org/
 
 
diff --git a/cmd/make.go b/cmd/make.go
index 7d8506d3..1760318f 100644
--- a/cmd/make.go
+++ b/cmd/make.go
@@ -83,8 +83,8 @@ const (
 )
 
 func init() {
-	if inWindows {
-		for index, file := range gopBinFiles {
+	for index, file := range gopBinFiles {
+		if inWindows {
 			file += ".exe"
 			gopBinFiles[index] = file
 		}
@@ -233,9 +233,6 @@ func buildGoplusTools(useGoProxy bool) {
 	}
 	print(buildOutput)
 
-	// Clear gop run cache
-	cleanGopRunCache()
-
 	installPath := linkGoplusToLocalBin()
 
 	println("\nGo+ tools installed successfully!")
@@ -296,22 +293,6 @@ func clean() {
 			log.Fatalln(err)
 		}
 	}
-
-	cleanGopRunCache()
-}
-
-func cleanGopRunCache() {
-	homeDir, _ := os.UserHomeDir()
-	runCacheDir := filepath.Join(homeDir, ".gop", "run")
-	files := []string{"go.mod", "go.sum"}
-	for _, file := range files {
-		fullPath := filepath.Join(runCacheDir, file)
-		if checkPathExist(fullPath, false) {
-			if err := os.Remove(fullPath); err != nil {
-				log.Fatalln(err)
-			}
-		}
-	}
 }
 
 func uninstall() {
diff --git a/go.mod b/go.mod
index 7e5c7c1a..65b1c556 100644
--- a/go.mod
+++ b/go.mod
@@ -3,7 +3,7 @@ module github.com/goplus/gop
 go 1.16
 
 require (
-	github.com/goplus/gox v1.8.6
+	github.com/goplus/gox v1.8.7
 	github.com/qiniu/x v1.11.5
 	golang.org/x/mod v0.5.1
 	golang.org/x/tools v0.1.8
diff --git a/go.sum b/go.sum
index 9bbd40ca..e18552a7 100644
--- a/go.sum
+++ b/go.sum
@@ -1,5 +1,5 @@
-github.com/goplus/gox v1.8.6 h1:2Nm++uPwQe9vMWWLS5fXhV7A/P+amwTtexUKtzv1YvI=
-github.com/goplus/gox v1.8.6/go.mod h1:XWqV75HImeysI8+Q9gAdYyvwlP8jds24xsgYRwTO3JI=
+github.com/goplus/gox v1.8.7 h1:XtUEazI+EMSyN9A0IGbrPe99dpT5lnD1k98HwmVL9Nc=
+github.com/goplus/gox v1.8.7/go.mod h1:XWqV75HImeysI8+Q9gAdYyvwlP8jds24xsgYRwTO3JI=
 github.com/qiniu/x v1.11.5 h1:TYr5cl4g2yoHAZeDK4MTjKF6CMoG+IHlCDvvM5qym6U=
 github.com/qiniu/x v1.11.5/go.mod h1:03Ni9tj+N2h2aKnAz+6N0Xfl8FwMEDRC2PAlxekASDs=
 github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=


Test patch:
diff --git a/cmd/make_test.go b/cmd/make_test.go
deleted file mode 100644
index b63bb311..00000000
--- a/cmd/make_test.go
+++ /dev/null
@@ -1,104 +0,0 @@
-//go:build ignore
-// +build ignore
-
-package make_test
-
-import (
-	"os"
-	"os/exec"
-	"path/filepath"
-	"runtime"
-	"testing"
-)
-
-const (
-	inWindows = (runtime.GOOS == "windows")
-)
-
-var script = "all.bash"
-var gopRoot = ""
-var gopBinFiles = []string{"gop", "gopfmt"}
-
-func checkPathExist(path string, isDir bool) bool {
-	stat, err := os.Stat(path)
-	isExists := !os.IsNotExist(err)
-	if isDir {
-		return isExists && stat.IsDir()
-	}
-	return isExists && !stat.IsDir()
-}
-
-func detectGoBinPath() string {
-	goBin, ok := os.LookupEnv("GOBIN")
-	if ok {
-		return goBin
-	}
-
-	goPath, ok := os.LookupEnv("GOPATH")
-	if ok {
-		list := filepath.SplitList(goPath)
-		if len(list) > 0 {
-			// Put in first directory of $GOPATH.
-			return filepath.Join(list[0], "bin")
-		}
-	}
-
-	homeDir, _ := os.UserHomeDir()
-	return filepath.Join(homeDir, "go", "bin")
-}
-
-func init() {
-	pwd, _ := os.Getwd()
-	gopRoot = filepath.Join(pwd, "..")
-	if inWindows {
-		script = "all.bat"
-		for index, file := range gopBinFiles {
-			file += ".exe"
-			gopBinFiles[index] = file
-		}
-	}
-}
-
-func TestAllScript(t *testing.T) {
-	os.Chdir(gopRoot)
-	cmd := exec.Command(filepath.Join(gopRoot, script))
-	if output, err := cmd.CombinedOutput(); err != nil {
-		t.Fatalf("Failed: %v:\nOut: %s\n", err, output)
-	}
-
-	goBinPath := detectGoBinPath()
-
-	for _, file := range gopBinFiles {
-		if !checkPathExist(filepath.Join(gopRoot, "bin", file), false) {
-			t.Fatalf("Failed: %s not found in ./bin directory\n", file)
-		}
-		if !checkPathExist(filepath.Join(goBinPath, file), false) {
-			t.Fatalf("Failed: %s not found in %s/bin directory\n", file, goBinPath)
-		}
-	}
-
-	cmd = exec.Command(filepath.Join(gopRoot, "bin", gopBinFiles[0]), "version")
-	if output, err := cmd.CombinedOutput(); err != nil {
-		t.Fatalf("Failed: %v:\nOut: %s\n", err, output)
-	}
-}
-
-func TestHandleMultiFlags(t *testing.T) {
-	os.Chdir(gopRoot)
-	cmd := exec.Command("go", "run", filepath.Join(gopRoot, "cmd/make.go"), "--install", "--test", "--uninstall")
-	if output, err := cmd.CombinedOutput(); err != nil {
-		t.Fatalf("Failed: %v:\nOut: %s\n", err, output)
-	}
-
-	goBinPath := detectGoBinPath()
-
-	// Uninstall will be the last action to run, test if all build assets being cleared.
-	for _, file := range gopBinFiles {
-		if checkPathExist(filepath.Join(gopRoot, "bin", file), false) {
-			t.Fatalf("Failed: %s found in ./bin directory\n", file)
-		}
-		if checkPathExist(filepath.Join(goBinPath, file), false) {
-			t.Fatalf("Failed: %s found in %s/bin directory\n", file, goBinPath)
-		}
-	}
-}