Repository: goplus/gop
Pull request #1389 (2023-07-03 08:05:45)

update github.com/gop/mod


Patch:
diff --git a/cl/compile.go b/cl/compile.go
index 54f9d0aa..bb396960 100644
--- a/cl/compile.go
+++ b/cl/compile.go
@@ -32,7 +32,7 @@ import (
 	"github.com/goplus/gop/token"
 	"github.com/goplus/gox"
 	"github.com/goplus/gox/cpackages"
-	"github.com/goplus/mod/gopmod"
+	"github.com/goplus/mod/modfile"
 	"github.com/qiniu/x/errors"
 )
 
@@ -62,7 +62,8 @@ func SetDebug(flags int) {
 
 // -----------------------------------------------------------------------------
 
-type Project = gopmod.Project
+type Project = modfile.Project
+type Class = modfile.Class
 
 // Config of loading Go+ packages.
 type Config struct {
diff --git a/go.mod b/go.mod
index e141d5e7..e41996ab 100644
--- a/go.mod
+++ b/go.mod
@@ -6,6 +6,6 @@ require (
 	github.com/goplus/c2go v0.7.13
 	github.com/goplus/gox v1.11.35
 	github.com/goplus/libc v0.3.13
-	github.com/goplus/mod v0.10.0
+	github.com/goplus/mod v0.10.1
 	github.com/qiniu/x v1.11.9
 )
diff --git a/go.sum b/go.sum
index 19224284..994bf61c 100644
--- a/go.sum
+++ b/go.sum
@@ -12,8 +12,8 @@ github.com/goplus/gox v1.11.35/go.mod h1:GcmPyIyC2t4Nfam7x6YRpe1IW9rf4nchgRpE19h
 github.com/goplus/libc v0.3.13 h1:2yHG8ghezBTK3Da7Fw1lNiitmt+Va+RzwKJ5GuqypCQ=
 github.com/goplus/libc v0.3.13/go.mod h1:xqG4/g3ilKBE/UDn5vkaE7RRQPQPyspj7ecuMuvlQJ8=
 github.com/goplus/mod v0.9.12/go.mod h1:YoPIowz71rnLLROA4YG0AC8bzDtPRyMaQwgTRLr8ri4=
-github.com/goplus/mod v0.10.0 h1:S9H/dwS4/IMzUX+Bq9Lb3tkPT3tzU6ws+hKeKI+Uo7g=
-github.com/goplus/mod v0.10.0/go.mod h1:cD7VktDd88SM0fPJ9oT3z5r8KTBW+EGi0gA3G8cDKHo=
+github.com/goplus/mod v0.10.1 h1:us4GMfWL+7tcK8diI7Z90awoVmUgDhftt83NeeqgYE4=
+github.com/goplus/mod v0.10.1/go.mod h1:cD7VktDd88SM0fPJ9oT3z5r8KTBW+EGi0gA3G8cDKHo=
 github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
 github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
 github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc=


Test patch:
diff --git a/cl/builtin_test.go b/cl/builtin_test.go
index 6e123871..1f0d3ff1 100644
--- a/cl/builtin_test.go
+++ b/cl/builtin_test.go
@@ -26,7 +26,7 @@ import (
 	"github.com/goplus/gox"
 	"github.com/goplus/gox/cpackages"
 	"github.com/goplus/gox/packages"
-	"github.com/goplus/mod/gopmod"
+	"github.com/goplus/mod/modfile"
 )
 
 var (
@@ -146,23 +146,23 @@ func TestSpxLookup(t *testing.T) {
 	spxLookup(nil, "foo")
 }
 
-func lookupClass(ext string) (c *gopmod.Project, ok bool) {
+func lookupClass(ext string) (c *modfile.Project, ok bool) {
 	switch ext {
 	case ".t2gmx", ".t2spx":
-		return &gopmod.Project{
+		return &modfile.Project{
 			Ext: ".t2gmx", Class: "Game",
-			Works:    []*gopmod.Class{{Ext: ".t2spx", Class: "Sprite"}},
+			Works:    []*modfile.Class{{Ext: ".t2spx", Class: "Sprite"}},
 			PkgPaths: []string{"github.com/goplus/gop/cl/internal/spx2"}}, true
 	}
 	return
 }
 
-func lookupClassErr(ext string) (c *gopmod.Project, ok bool) {
+func lookupClassErr(ext string) (c *modfile.Project, ok bool) {
 	switch ext {
 	case ".t2gmx", ".t2spx":
-		return &gopmod.Project{
+		return &modfile.Project{
 			Ext: ".t2gmx", Class: "Game",
-			Works:    []*gopmod.Class{{Ext: ".t2spx", Class: "Sprite"}},
+			Works:    []*modfile.Class{{Ext: ".t2spx", Class: "Sprite"}},
 			PkgPaths: []string{"github.com/goplus/gop/cl/internal/libc"}}, true
 	}
 	return
diff --git a/cl/compile_spx_test.go b/cl/compile_spx_test.go
index 50bdbbbc..e7a64022 100644
--- a/cl/compile_spx_test.go
+++ b/cl/compile_spx_test.go
@@ -25,25 +25,25 @@ import (
 	"github.com/goplus/gop/parser"
 	"github.com/goplus/gop/parser/parsertest"
 	"github.com/goplus/gop/scanner"
-	"github.com/goplus/mod/gopmod"
+	"github.com/goplus/mod/modfile"
 )
 
-func lookupClass(ext string) (c *gopmod.Project, ok bool) {
+func lookupClass(ext string) (c *modfile.Project, ok bool) {
 	switch ext {
 	case ".tgmx", ".tspx":
-		return &gopmod.Project{
+		return &modfile.Project{
 			Ext: ".tgmx", Class: "*MyGame",
-			Works:    []*gopmod.Class{{Ext: ".tspx", Class: "Sprite"}},
+			Works:    []*modfile.Class{{Ext: ".tspx", Class: "Sprite"}},
 			PkgPaths: []string{"github.com/goplus/gop/cl/internal/spx", "math"}}, true
 	case ".t2gmx", ".t2spx", ".t2spx2":
-		return &gopmod.Project{
+		return &modfile.Project{
 			Ext: ".t2gmx", Class: "Game",
-			Works: []*gopmod.Class{{Ext: ".t2spx", Class: "Sprite"},
+			Works: []*modfile.Class{{Ext: ".t2spx", Class: "Sprite"},
 				{Ext: ".t2spx2", Class: "Sprite2"}},
 			PkgPaths: []string{"github.com/goplus/gop/cl/internal/spx2"}}, true
 	case ".t3spx", ".t3spx2":
-		return &gopmod.Project{
-			Works: []*gopmod.Class{{Ext: ".t3spx", Class: "Sprite"},
+		return &modfile.Project{
+			Works: []*modfile.Class{{Ext: ".t3spx", Class: "Sprite"},
 				{Ext: ".t3spx2", Class: "Sprite2"}},
 			PkgPaths: []string{"github.com/goplus/gop/cl/internal/spx2"}}, true
 	}