Răsfoiți Sursa

Merge commit 'ffbe0f43d130ba1f5310fa5c02ef37b24ee78184' into maccatalyst

Amir Khan 9 luni în urmă
părinte
comite
2654c64f94
100 a modificat fișierele cu 236 adăugiri și 254 ștergeri
  1. 2 2
      MobileLibrary/go-mobile/LICENSE
  2. 4 2
      MobileLibrary/go-mobile/README.md
  3. 1 2
      MobileLibrary/go-mobile/app/app_test.go
  4. 1 1
      MobileLibrary/go-mobile/app/doc.go
  5. 0 23
      MobileLibrary/go-mobile/asset/asset_darwin_armx.go
  6. 1 1
      MobileLibrary/go-mobile/asset/asset_desktop.go
  7. 13 0
      MobileLibrary/go-mobile/asset/asset_ios.go
  8. 1 1
      MobileLibrary/go-mobile/asset/doc.go
  9. 1 1
      MobileLibrary/go-mobile/bind/bind.go
  10. 13 10
      MobileLibrary/go-mobile/bind/bind_test.go
  11. 4 4
      MobileLibrary/go-mobile/bind/genclasses.go
  12. 1 1
      MobileLibrary/go-mobile/bind/gengo.go
  13. 9 9
      MobileLibrary/go-mobile/bind/genjava.go
  14. 1 1
      MobileLibrary/go-mobile/bind/genobjc.go
  15. 4 6
      MobileLibrary/go-mobile/bind/genobjcw.go
  16. 1 1
      MobileLibrary/go-mobile/bind/java/context_android.go
  17. 5 6
      MobileLibrary/go-mobile/bind/java/seq_test.go
  18. 3 4
      MobileLibrary/go-mobile/bind/objc/seq_test.go
  19. 1 1
      MobileLibrary/go-mobile/bind/seq/seq.go
  20. 1 1
      MobileLibrary/go-mobile/bind/testdata/basictypes.go
  21. 1 1
      MobileLibrary/go-mobile/bind/testdata/classes.go
  22. 1 1
      MobileLibrary/go-mobile/bind/testdata/customprefix.go
  23. 1 1
      MobileLibrary/go-mobile/bind/testdata/doc.go
  24. 1 1
      MobileLibrary/go-mobile/bind/testdata/ignore.go
  25. 1 1
      MobileLibrary/go-mobile/bind/testdata/interfaces.go
  26. 1 1
      MobileLibrary/go-mobile/bind/testdata/issue10788.go
  27. 1 1
      MobileLibrary/go-mobile/bind/testdata/issue12328.go
  28. 1 1
      MobileLibrary/go-mobile/bind/testdata/java.go
  29. 1 1
      MobileLibrary/go-mobile/bind/testdata/keywords.go
  30. 1 1
      MobileLibrary/go-mobile/bind/testdata/objc.go
  31. 1 1
      MobileLibrary/go-mobile/bind/testdata/objcw.go
  32. 1 1
      MobileLibrary/go-mobile/bind/testdata/structs.go
  33. 2 2
      MobileLibrary/go-mobile/bind/testdata/testpkg/testpkg.go
  34. 1 1
      MobileLibrary/go-mobile/bind/testdata/try.go
  35. 2 2
      MobileLibrary/go-mobile/cmd/gobind/doc.go
  36. 11 12
      MobileLibrary/go-mobile/cmd/gobind/gen.go
  37. 1 1
      MobileLibrary/go-mobile/cmd/gobind/gobind_test.go
  38. 2 3
      MobileLibrary/go-mobile/cmd/gobind/main.go
  39. 2 3
      MobileLibrary/go-mobile/cmd/gomobile/bind.go
  40. 3 4
      MobileLibrary/go-mobile/cmd/gomobile/bind_androidapp.go
  41. 1 1
      MobileLibrary/go-mobile/cmd/gomobile/bind_iosapp.go
  42. 1 1
      MobileLibrary/go-mobile/cmd/gomobile/bind_test.go
  43. 1 1
      MobileLibrary/go-mobile/cmd/gomobile/build.go
  44. 3 4
      MobileLibrary/go-mobile/cmd/gomobile/build_androidapp.go
  45. 2 3
      MobileLibrary/go-mobile/cmd/gomobile/build_apple.go
  46. 1 1
      MobileLibrary/go-mobile/cmd/gomobile/build_darwin_test.go
  47. 2 3
      MobileLibrary/go-mobile/cmd/gomobile/build_test.go
  48. 1 1
      MobileLibrary/go-mobile/cmd/gomobile/cert.go
  49. 2 3
      MobileLibrary/go-mobile/cmd/gomobile/cert_test.go
  50. 1 1
      MobileLibrary/go-mobile/cmd/gomobile/clean.go
  51. 1 1
      MobileLibrary/go-mobile/cmd/gomobile/dex.go
  52. 2 2
      MobileLibrary/go-mobile/cmd/gomobile/doc.go
  53. 31 26
      MobileLibrary/go-mobile/cmd/gomobile/env.go
  54. 2 3
      MobileLibrary/go-mobile/cmd/gomobile/env_test.go
  55. 4 5
      MobileLibrary/go-mobile/cmd/gomobile/gendex.go
  56. 3 4
      MobileLibrary/go-mobile/cmd/gomobile/init.go
  57. 3 4
      MobileLibrary/go-mobile/cmd/gomobile/init_test.go
  58. 1 1
      MobileLibrary/go-mobile/cmd/gomobile/install.go
  59. 3 4
      MobileLibrary/go-mobile/cmd/gomobile/main.go
  60. 1 1
      MobileLibrary/go-mobile/cmd/gomobile/manifest.go
  61. 1 1
      MobileLibrary/go-mobile/cmd/gomobile/strings_flag.go
  62. 1 1
      MobileLibrary/go-mobile/cmd/gomobile/version.go
  63. 1 1
      MobileLibrary/go-mobile/cmd/gomobile/writer.go
  64. 3 4
      MobileLibrary/go-mobile/cmd/gomobile/writer_test.go
  65. 1 1
      MobileLibrary/go-mobile/event/lifecycle/lifecycle.go
  66. 1 1
      MobileLibrary/go-mobile/event/mouse/mouse.go
  67. 1 1
      MobileLibrary/go-mobile/event/paint/paint.go
  68. 1 1
      MobileLibrary/go-mobile/event/size/size.go
  69. 1 1
      MobileLibrary/go-mobile/event/touch/touch.go
  70. 1 1
      MobileLibrary/go-mobile/example/ivy/doc.go
  71. 1 1
      MobileLibrary/go-mobile/example/ivy/go.mod
  72. 2 2
      MobileLibrary/go-mobile/example/ivy/tools.go
  73. 1 1
      MobileLibrary/go-mobile/exp/app/debug/fps.go
  74. 1 1
      MobileLibrary/go-mobile/exp/audio/al/al.go
  75. 4 0
      MobileLibrary/go-mobile/exp/f32/affine_test.go
  76. 1 1
      MobileLibrary/go-mobile/exp/f32/f32.go
  77. 2 2
      MobileLibrary/go-mobile/exp/f32/gen.go
  78. 1 1
      MobileLibrary/go-mobile/exp/font/doc.go
  79. 3 3
      MobileLibrary/go-mobile/exp/font/font_android.go
  80. 5 5
      MobileLibrary/go-mobile/exp/font/font_linux.go
  81. 1 1
      MobileLibrary/go-mobile/exp/gl/glutil/doc.go
  82. 1 1
      MobileLibrary/go-mobile/exp/gl/glutil/glutil.go
  83. 1 1
      MobileLibrary/go-mobile/exp/sensor/sensor.go
  84. 1 1
      MobileLibrary/go-mobile/exp/sprite/clock/clock.go
  85. 1 1
      MobileLibrary/go-mobile/exp/sprite/glsprite/glsprite.go
  86. 1 2
      MobileLibrary/go-mobile/exp/sprite/portable/affine_test.go
  87. 1 1
      MobileLibrary/go-mobile/exp/sprite/portable/portable.go
  88. 1 1
      MobileLibrary/go-mobile/exp/sprite/sprite.go
  89. 1 1
      MobileLibrary/go-mobile/geom/geom.go
  90. 1 1
      MobileLibrary/go-mobile/gl/consts.go
  91. 8 9
      MobileLibrary/go-mobile/gl/dll_windows.go
  92. 2 2
      MobileLibrary/go-mobile/gl/doc.go
  93. 1 1
      MobileLibrary/go-mobile/gl/fn.go
  94. 3 4
      MobileLibrary/go-mobile/gl/gendebug.go
  95. 1 1
      MobileLibrary/go-mobile/gl/gl.go
  96. 1 1
      MobileLibrary/go-mobile/gl/gldebug.go
  97. 5 5
      MobileLibrary/go-mobile/gl/interface.go
  98. 1 1
      MobileLibrary/go-mobile/gl/types_debug.go
  99. 1 1
      MobileLibrary/go-mobile/gl/types_prod.go
  100. 1 1
      MobileLibrary/go-mobile/gl/work.go

+ 2 - 2
MobileLibrary/go-mobile/LICENSE

@@ -1,4 +1,4 @@
-Copyright (c) 2009 The Go Authors. All rights reserved.
+Copyright 2009 The Go Authors.
 
 Redistribution and use in source and binary forms, with or without
 modification, are permitted provided that the following conditions are
@@ -10,7 +10,7 @@ notice, this list of conditions and the following disclaimer.
 copyright notice, this list of conditions and the following disclaimer
 in the documentation and/or other materials provided with the
 distribution.
-   * Neither the name of Google Inc. nor the names of its
+   * Neither the name of Google LLC nor the names of its
 contributors may be used to endorse or promote products derived from
 this software without specific prior written permission.
 

+ 4 - 2
MobileLibrary/go-mobile/README.md

@@ -24,9 +24,11 @@ and the [bind](https://golang.org/x/mobile/example/bind) example apps.
 
 --
 
-Contributions to Go are appreciated. See https://golang.org/doc/contribute.html.
+Contributions to Go are appreciated. See https://go.dev/doc/contribute.
 
-* Bugs can be filed at the [Go issue tracker](https://golang.org/issue/new?title=x/mobile:+).
+The git repository is https://go.googlesource.com/mobile.
+
+* Bugs can be filed at the [Go issue tracker](https://go.dev/issue/new?title=x/mobile:+).
 * Feature requests should preliminary be discussed on
 [golang-nuts](https://groups.google.com/forum/#!forum/golang-nuts)
 mailing list.

+ 1 - 2
MobileLibrary/go-mobile/app/app_test.go

@@ -9,7 +9,6 @@ import (
 	"image"
 	"image/color"
 	_ "image/png"
-	"io/ioutil"
 	"net"
 	"os"
 	"os/exec"
@@ -56,7 +55,7 @@ func TestAndroidApp(t *testing.T) {
 		t.Fatal(err)
 	}
 
-	tmpdir, err := ioutil.TempDir("", "app-test-")
+	tmpdir, err := os.MkdirTemp("", "app-test-")
 	if err != nil {
 		t.Fatal(err)
 	}

+ 1 - 1
MobileLibrary/go-mobile/app/doc.go

@@ -85,4 +85,4 @@ response to lifecycle events. Such packages should call:
 
 in an init function inside that package.
 */
-package app // import "golang.org/x/mobile/app"
+package app

+ 0 - 23
MobileLibrary/go-mobile/asset/asset_darwin_armx.go

@@ -1,23 +0,0 @@
-// Copyright 2015 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-//go:build darwin && (arm || arm64)
-
-package asset
-
-import (
-	"os"
-	"path/filepath"
-)
-
-func openAsset(name string) (File, error) {
-	if !filepath.IsAbs(name) {
-		name = filepath.Join("assets", name)
-	}
-	f, err := os.Open(name)
-	if err != nil {
-		return nil, err
-	}
-	return f, nil
-}

+ 1 - 1
MobileLibrary/go-mobile/asset/asset_desktop.go

@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-//go:build (linux && !android) || (darwin && !arm && !arm64) || windows
+//go:build (linux && !android) || (darwin && !ios) || windows
 
 package asset
 

+ 13 - 0
MobileLibrary/go-mobile/asset/asset_ios.go

@@ -0,0 +1,13 @@
+// Copyright 2024 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package asset
+
+import (
+	"os"
+)
+
+func openAsset(name string) (File, error) {
+	return os.Open(name)
+}

+ 1 - 1
MobileLibrary/go-mobile/asset/doc.go

@@ -14,4 +14,4 @@
 //
 // For consistency when debugging on a desktop, assets are read from a
 // directory named assets under the current working directory.
-package asset // import "golang.org/x/mobile/asset"
+package asset

+ 1 - 1
MobileLibrary/go-mobile/bind/bind.go

@@ -7,7 +7,7 @@
 // See the documentation on the gobind command for usage details
 // and the list of currently supported types.
 // (http://godoc.org/golang.org/x/mobile/cmd/gobind)
-package bind // import "golang.org/x/mobile/bind"
+package bind
 
 // TODO(crawshaw): slice support
 // TODO(crawshaw): channel support

+ 13 - 10
MobileLibrary/go-mobile/bind/bind_test.go

@@ -1,3 +1,7 @@
+// Copyright 2014 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
 package bind
 
 import (
@@ -11,7 +15,6 @@ import (
 	"go/token"
 	"go/types"
 	"io"
-	"io/ioutil"
 	"log"
 	"os"
 	"os/exec"
@@ -121,7 +124,7 @@ func diff(a, b string) string {
 }
 
 func writeTempFile(t *testing.T, name string, contents []byte) string {
-	f, err := ioutil.TempFile("", name)
+	f, err := os.CreateTemp("", name)
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -215,14 +218,14 @@ func genObjcPackages(t *testing.T, dir string, cg *ObjcWrapper) {
 		pkgFile := filepath.Join(pkgDir, "package.go")
 		cg.Buf.Reset()
 		cg.GenPackage(i)
-		if err := ioutil.WriteFile(pkgFile, cg.Buf.Bytes(), 0600); err != nil {
+		if err := os.WriteFile(pkgFile, cg.Buf.Bytes(), 0600); err != nil {
 			t.Fatal(err)
 		}
 	}
 	cg.Buf.Reset()
 	cg.GenInterfaces()
 	clsFile := filepath.Join(pkgBase, "interfaces.go")
-	if err := ioutil.WriteFile(clsFile, cg.Buf.Bytes(), 0600); err != nil {
+	if err := os.WriteFile(clsFile, cg.Buf.Bytes(), 0600); err != nil {
 		t.Fatal(err)
 	}
 
@@ -254,7 +257,7 @@ func genJavaPackages(t *testing.T, dir string, cg *ClassGen) {
 		pkgFile := filepath.Join(pkgDir, "package.go")
 		cg.Buf.Reset()
 		cg.GenPackage(i)
-		if err := ioutil.WriteFile(pkgFile, cg.Buf.Bytes(), 0600); err != nil {
+		if err := os.WriteFile(pkgFile, cg.Buf.Bytes(), 0600); err != nil {
 			t.Fatal(err)
 		}
 		io.Copy(buf, cg.Buf)
@@ -262,7 +265,7 @@ func genJavaPackages(t *testing.T, dir string, cg *ClassGen) {
 	cg.Buf.Reset()
 	cg.GenInterfaces()
 	clsFile := filepath.Join(pkgBase, "interfaces.go")
-	if err := ioutil.WriteFile(clsFile, cg.Buf.Bytes(), 0600); err != nil {
+	if err := os.WriteFile(clsFile, cg.Buf.Bytes(), 0600); err != nil {
 		t.Fatal(err)
 	}
 	io.Copy(buf, cg.Buf)
@@ -302,7 +305,7 @@ func TestGenJava(t *testing.T) {
 			}
 			tmpGopath := ""
 			if len(classes) > 0 {
-				tmpGopath, err = ioutil.TempDir(os.TempDir(), "gomobile-bind-test-")
+				tmpGopath, err = os.MkdirTemp(os.TempDir(), "gomobile-bind-test-")
 				if err != nil {
 					t.Fatal(err)
 				}
@@ -419,7 +422,7 @@ func TestGenGoJavaWrappers(t *testing.T) {
 		if err != nil {
 			t.Fatal(err)
 		}
-		tmpGopath, err := ioutil.TempDir(os.TempDir(), "gomobile-bind-test-")
+		tmpGopath, err := os.MkdirTemp(os.TempDir(), "gomobile-bind-test-")
 		if err != nil {
 			t.Fatal(err)
 		}
@@ -449,7 +452,7 @@ func TestGenGoObjcWrappers(t *testing.T) {
 		if err != nil {
 			t.Fatal(err)
 		}
-		tmpGopath, err := ioutil.TempDir(os.TempDir(), "gomobile-bind-test-")
+		tmpGopath, err := os.MkdirTemp(os.TempDir(), "gomobile-bind-test-")
 		if err != nil {
 			t.Fatal(err)
 		}
@@ -495,7 +498,7 @@ func testGenGo(t *testing.T, filename string, buf *bytes.Buffer, pkg *types.Pack
 	}
 	golden += ".golden"
 
-	goldenContents, err := ioutil.ReadFile(golden)
+	goldenContents, err := os.ReadFile(golden)
 	if err != nil {
 		t.Fatalf("failed to read golden file: %v", err)
 	}

+ 4 - 4
MobileLibrary/go-mobile/bind/genclasses.go

@@ -381,7 +381,7 @@ func (g *ClassGen) genCMethodBody(cls *java.Class, f *java.Func, virtual bool) {
 		g.Printf("Nonvirtual")
 	}
 	if f.Ret != nil {
-		g.Printf(f.Ret.JNICallType())
+		g.Printf("%s", f.Ret.JNICallType())
 	} else {
 		g.Printf("Void")
 	}
@@ -430,7 +430,7 @@ func (g *ClassGen) genFuncDecl(local bool, fs *java.FuncSet) {
 		if i == len(fs.Params)-1 && fs.Variadic {
 			g.Printf("...")
 		}
-		g.Printf(g.goType(a, local))
+		g.Printf("%s", g.goType(a, local))
 	}
 	g.Printf(")")
 	if fs.Throws {
@@ -879,7 +879,7 @@ func (g *ClassGen) genInterface(cls *java.Class) {
 		if !g.isFuncSetSupported(fs) {
 			continue
 		}
-		g.Printf(fs.GoName)
+		g.Printf("%s", fs.GoName)
 		g.genFuncDecl(true, fs)
 		g.Printf("\n")
 	}
@@ -904,7 +904,7 @@ func flattenName(n string) string {
 	return strings.Replace(strings.Replace(n, ".", "_", -1), "$", "_", -1)
 }
 
-var (
+const (
 	classesPkgHeader = gobindPreamble + `
 package Java
 

+ 1 - 1
MobileLibrary/go-mobile/bind/gengo.go

@@ -341,7 +341,7 @@ func (g *goGen) genInterface(obj *types.TypeName) {
 		g.Printf(") ")
 
 		if res.Len() == 1 {
-			g.Printf(g.typeString(res.At(0).Type()))
+			g.Printf("%s", g.typeString(res.At(0).Type()))
 		} else if res.Len() == 2 {
 			g.Printf("(%s, error)", g.typeString(res.At(0).Type()))
 		}

+ 9 - 9
MobileLibrary/go-mobile/bind/genjava.go

@@ -437,7 +437,7 @@ func (g *JavaGen) genConstructor(f *types.Func, n string, jcls bool) {
 			if i > 0 {
 				g.Printf(", ")
 			}
-			g.Printf(g.paramName(params, i))
+			g.Printf("%s", g.paramName(params, i))
 		}
 		g.Printf(");\n")
 	}
@@ -447,7 +447,7 @@ func (g *JavaGen) genConstructor(f *types.Func, n string, jcls bool) {
 		if i > 0 {
 			g.Printf(", ")
 		}
-		g.Printf(g.paramName(params, i))
+		g.Printf("%s", g.paramName(params, i))
 	}
 	g.Printf(");\n")
 	g.Printf("Seq.trackGoRef(refnum, this);\n")
@@ -757,21 +757,21 @@ func (g *JavaGen) genJNIFuncSignature(o *types.Func, sName string, jm *java.Func
 	g.Printf("Java_%s_", g.jniPkgName())
 	if sName != "" {
 		if proxy {
-			g.Printf(java.JNIMangle(g.className()))
+			g.Printf("%s", java.JNIMangle(g.className()))
 			// 0024 is the mangled form of $, for naming inner classes.
 			g.Printf("_00024proxy%s", sName)
 		} else {
-			g.Printf(java.JNIMangle(g.javaTypeName(sName)))
+			g.Printf("%s", java.JNIMangle(g.javaTypeName(sName)))
 		}
 	} else {
-		g.Printf(java.JNIMangle(g.className()))
+		g.Printf("%s", java.JNIMangle(g.className()))
 	}
 	g.Printf("_")
 	if jm != nil {
-		g.Printf(jm.JNIName)
+		g.Printf("%s", jm.JNIName)
 	} else {
 		oName := javaNameReplacer(lowerFirst(o.Name()))
-		g.Printf(java.JNIMangle(oName))
+		g.Printf("%s", java.JNIMangle(oName))
 	}
 	g.Printf("(JNIEnv* env, ")
 	if sName != "" {
@@ -839,9 +839,9 @@ func (g *JavaGen) genFuncSignature(o *types.Func, jm *java.Func, hasThis bool) {
 
 	g.Printf("%s ", ret)
 	if jm != nil {
-		g.Printf(jm.Name)
+		g.Printf("%s", jm.Name)
 	} else {
-		g.Printf(javaNameReplacer(lowerFirst(o.Name())))
+		g.Printf("%s", javaNameReplacer(lowerFirst(o.Name())))
 	}
 	g.Printf("(")
 	g.genFuncArgs(o, jm, hasThis)

+ 1 - 1
MobileLibrary/go-mobile/bind/genobjc.go

@@ -1060,7 +1060,7 @@ func (g *ObjcGen) genStructH(obj *types.TypeName, t *types.Struct) {
 	if oinf != nil {
 		for _, sup := range oinf.supers {
 			if !sup.Protocol {
-				g.Printf(sup.Name)
+				g.Printf("%s", sup.Name)
 			} else {
 				prots = append(prots, sup.Name)
 			}

+ 4 - 6
MobileLibrary/go-mobile/bind/genobjcw.go

@@ -286,14 +286,13 @@ func (g *ObjcWrapper) genCFuncDecl(prefix, name string, f *objc.Func) {
 	case ret != nil && returnsErr:
 		g.Printf("ret_%s", strings.Replace(g.cType(ret), " ", "_", -1))
 	case ret != nil:
-		g.Printf(g.cType(ret))
+		g.Printf("%s", g.cType(ret))
 	case returnsErr:
 		g.Printf("int")
 	default:
 		g.Printf("void")
 	}
-	g.Printf(" ")
-	g.Printf(prefix)
+	g.Printf(" %s", prefix)
 	if f.Static {
 		g.Printf("_s")
 	}
@@ -397,8 +396,7 @@ func (g *ObjcWrapper) genFuncBody(n *objc.Named, f *objc.Func, prefix string) {
 	if ret != nil || errParam != nil {
 		g.Printf("res := ")
 	}
-	g.Printf("C.")
-	g.Printf(prefix)
+	g.Printf("C.%s", prefix)
 	if f.Static {
 		g.Printf("_s")
 	}
@@ -575,7 +573,7 @@ func (g *ObjcWrapper) genInterface(n *objc.Named) {
 		if !g.isFuncSupported(f) {
 			continue
 		}
-		g.Printf(f.GoName)
+		g.Printf("%s", f.GoName)
 		g.genFuncDecl(true, f)
 		g.Printf("\n")
 	}

+ 1 - 1
MobileLibrary/go-mobile/bind/java/context_android.go

@@ -2,7 +2,7 @@
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-package java // import "golang.org/x/mobile/bind/java"
+package java
 
 // #cgo LDFLAGS: -llog
 //

+ 5 - 6
MobileLibrary/go-mobile/bind/java/seq_test.go

@@ -7,7 +7,6 @@ package java
 import (
 	"fmt"
 	"io"
-	"io/ioutil"
 	"log"
 	"os"
 	"os/exec"
@@ -28,7 +27,7 @@ func TestMain(m *testing.M) {
 
 func testMain(m *testing.M) int {
 	// Build gomobile and gobind and put them into PATH.
-	binDir, err := ioutil.TempDir("", "bind-java-test-")
+	binDir, err := os.MkdirTemp("", "bind-java-test-")
 	if err != nil {
 		log.Fatal(err)
 	}
@@ -117,7 +116,7 @@ func runTest(t *testing.T, pkgNames []string, javaPkg, javaCls string) {
 	if err != nil {
 		t.Fatalf("failed pwd: %v", err)
 	}
-	tmpdir, err := ioutil.TempDir("", "bind-java-seq-test-")
+	tmpdir, err := os.MkdirTemp("", "bind-java-seq-test-")
 	if err != nil {
 		t.Fatalf("failed to prepare temp dir: %v", err)
 	}
@@ -164,20 +163,20 @@ func runTest(t *testing.T, pkgNames []string, javaPkg, javaCls string) {
 	}
 
 	fname = filepath.Join(tmpdir, "src/main/AndroidManifest.xml")
-	err = ioutil.WriteFile(fname, []byte(androidmanifest), 0700)
+	err = os.WriteFile(fname, []byte(androidmanifest), 0700)
 	if err != nil {
 		t.Fatalf("failed to write android manifest file: %v", err)
 	}
 
 	// Add a dummy string resource to avoid errors from the Android build system.
 	fname = filepath.Join(tmpdir, "src/main/res/values/strings.xml")
-	err = ioutil.WriteFile(fname, []byte(stringsxml), 0700)
+	err = os.WriteFile(fname, []byte(stringsxml), 0700)
 	if err != nil {
 		t.Fatalf("failed to write strings.xml file: %v", err)
 	}
 
 	fname = filepath.Join(tmpdir, "build.gradle")
-	err = ioutil.WriteFile(fname, []byte(buildgradle), 0700)
+	err = os.WriteFile(fname, []byte(buildgradle), 0700)
 	if err != nil {
 		t.Fatalf("failed to write build.gradle file: %v", err)
 	}

+ 3 - 4
MobileLibrary/go-mobile/bind/objc/seq_test.go

@@ -8,7 +8,6 @@ import (
 	"flag"
 	"fmt"
 	"io"
-	"io/ioutil"
 	"log"
 	"os"
 	"os/exec"
@@ -43,7 +42,7 @@ func TestMain(m *testing.M) {
 }
 
 func testMain(m *testing.M) int {
-	binDir, err := ioutil.TempDir("", "bind-objc-test-")
+	binDir, err := os.MkdirTemp("", "bind-objc-test-")
 	if err != nil {
 		log.Fatal(err)
 	}
@@ -108,7 +107,7 @@ func runTest(t *testing.T, pkgNames []string, prefix, testfile, framework string
 		t.Skip("command xcodebuild not found, skipping")
 	}
 
-	tmpdir, err := ioutil.TempDir("", "bind-objc-seq-test-")
+	tmpdir, err := os.MkdirTemp("", "bind-objc-seq-test-")
 	if err != nil {
 		t.Fatalf("failed to prepare temp dir: %v", err)
 	}
@@ -200,7 +199,7 @@ func createProject(dir, testfile, framework string) error {
 		{"xcodetest/AppDelegate.m", appdelegatem},
 	}
 	for _, f := range files {
-		if err := ioutil.WriteFile(filepath.Join(dir, f.path), []byte(f.content), 0700); err != nil {
+		if err := os.WriteFile(filepath.Join(dir, f.path), []byte(f.content), 0700); err != nil {
 			return err
 		}
 	}

+ 1 - 1
MobileLibrary/go-mobile/bind/seq/seq.go

@@ -9,7 +9,7 @@
 //
 // Designed only for use by the code generated by gobind. Don't try to
 // use this directly.
-package seq // import "golang.org/x/mobile/bind/seq"
+package seq
 
 import _ "golang.org/x/mobile/internal/mobileinit"
 

+ 1 - 1
MobileLibrary/go-mobile/bind/testdata/basictypes.go

@@ -1,4 +1,4 @@
-// Copyright 2014 The Go Authors.  All rights reserved.
+// Copyright 2014 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 

+ 1 - 1
MobileLibrary/go-mobile/bind/testdata/classes.go

@@ -1,4 +1,4 @@
-// Copyright 2014 The Go Authors.  All rights reserved.
+// Copyright 2014 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 

+ 1 - 1
MobileLibrary/go-mobile/bind/testdata/customprefix.go

@@ -1,4 +1,4 @@
-// Copyright 2015 The Go Authors.  All rights reserved.
+// Copyright 2015 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 

+ 1 - 1
MobileLibrary/go-mobile/bind/testdata/doc.go

@@ -1,4 +1,4 @@
-// Copyright 2016 The Go Authors.  All rights reserved.
+// Copyright 2016 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 

+ 1 - 1
MobileLibrary/go-mobile/bind/testdata/ignore.go

@@ -1,4 +1,4 @@
-// Copyright 2016 The Go Authors.  All rights reserved.
+// Copyright 2016 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 

+ 1 - 1
MobileLibrary/go-mobile/bind/testdata/interfaces.go

@@ -1,4 +1,4 @@
-// Copyright 2014 The Go Authors.  All rights reserved.
+// Copyright 2014 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 

+ 1 - 1
MobileLibrary/go-mobile/bind/testdata/issue10788.go

@@ -1,4 +1,4 @@
-// Copyright 2015 The Go Authors.  All rights reserved.
+// Copyright 2015 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 

+ 1 - 1
MobileLibrary/go-mobile/bind/testdata/issue12328.go

@@ -1,4 +1,4 @@
-// Copyright 2015 The Go Authors.  All rights reserved.
+// Copyright 2015 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 

+ 1 - 1
MobileLibrary/go-mobile/bind/testdata/java.go

@@ -1,4 +1,4 @@
-// Copyright 2014 The Go Authors.  All rights reserved.
+// Copyright 2014 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 

+ 1 - 1
MobileLibrary/go-mobile/bind/testdata/keywords.go

@@ -1,4 +1,4 @@
-// Copyright 2014 The Go Authors.  All rights reserved.
+// Copyright 2014 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 

+ 1 - 1
MobileLibrary/go-mobile/bind/testdata/objc.go

@@ -1,4 +1,4 @@
-// Copyright 2014 The Go Authors.  All rights reserved.
+// Copyright 2014 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 

+ 1 - 1
MobileLibrary/go-mobile/bind/testdata/objcw.go

@@ -1,4 +1,4 @@
-// Copyright 2014 The Go Authors.  All rights reserved.
+// Copyright 2014 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 

+ 1 - 1
MobileLibrary/go-mobile/bind/testdata/structs.go

@@ -1,4 +1,4 @@
-// Copyright 2014 The Go Authors.  All rights reserved.
+// Copyright 2014 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 

+ 2 - 2
MobileLibrary/go-mobile/bind/testdata/testpkg/testpkg.go

@@ -12,7 +12,7 @@ import (
 	"context"
 	"errors"
 	"fmt"
-	"io/ioutil"
+	"io"
 	"log"
 	"math"
 	"os"
@@ -232,7 +232,7 @@ func ReadAsset() string {
 	}
 	defer rc.Close()
 
-	b, err := ioutil.ReadAll(rc)
+	b, err := io.ReadAll(rc)
 	if err != nil {
 		log.Fatal(err)
 	}

+ 1 - 1
MobileLibrary/go-mobile/bind/testdata/try.go

@@ -1,4 +1,4 @@
-// Copyright 2015 The Go Authors.  All rights reserved.
+// Copyright 2015 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 

+ 2 - 2
MobileLibrary/go-mobile/cmd/gobind/doc.go

@@ -1,4 +1,4 @@
-// Copyright 2014 The Go Authors.  All rights reserved.
+// Copyright 2014 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
@@ -249,4 +249,4 @@ Examples can be found in http://golang.org/x/mobile/example.
 
 Design doc: http://golang.org/s/gobind
 */
-package main // import "golang.org/x/mobile/cmd/gobind"
+package main

+ 11 - 12
MobileLibrary/go-mobile/cmd/gobind/gen.go

@@ -1,4 +1,4 @@
-// Copyright 2014 The Go Authors.  All rights reserved.
+// Copyright 2014 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
@@ -11,7 +11,6 @@ import (
 	"go/token"
 	"go/types"
 	"io"
-	"io/ioutil"
 	"os"
 	"path/filepath"
 	"strings"
@@ -203,7 +202,7 @@ func genObjcPackages(dir string, types []*objc.Named, embedders []importers.Stru
 		pkgFile := filepath.Join(pkgDir, "package.go")
 		buf.Reset()
 		cg.GenPackage(i)
-		if err := ioutil.WriteFile(pkgFile, buf.Bytes(), 0600); err != nil {
+		if err := os.WriteFile(pkgFile, buf.Bytes(), 0600); err != nil {
 			return err
 		}
 	}
@@ -213,7 +212,7 @@ func genObjcPackages(dir string, types []*objc.Named, embedders []importers.Stru
 	if err := os.MkdirAll(objcBase, 0700); err != nil {
 		return err
 	}
-	if err := ioutil.WriteFile(filepath.Join(objcBase, "interfaces.go"), buf.Bytes(), 0600); err != nil {
+	if err := os.WriteFile(filepath.Join(objcBase, "interfaces.go"), buf.Bytes(), 0600); err != nil {
 		return err
 	}
 	goBase := filepath.Join(dir, "src", "gobind")
@@ -222,17 +221,17 @@ func genObjcPackages(dir string, types []*objc.Named, embedders []importers.Stru
 	}
 	buf.Reset()
 	cg.GenGo()
-	if err := ioutil.WriteFile(filepath.Join(goBase, "interfaces_darwin.go"), buf.Bytes(), 0600); err != nil {
+	if err := os.WriteFile(filepath.Join(goBase, "interfaces_darwin.go"), buf.Bytes(), 0600); err != nil {
 		return err
 	}
 	buf.Reset()
 	cg.GenH()
-	if err := ioutil.WriteFile(filepath.Join(goBase, "interfaces.h"), buf.Bytes(), 0600); err != nil {
+	if err := os.WriteFile(filepath.Join(goBase, "interfaces.h"), buf.Bytes(), 0600); err != nil {
 		return err
 	}
 	buf.Reset()
 	cg.GenM()
-	if err := ioutil.WriteFile(filepath.Join(goBase, "interfaces_darwin.m"), buf.Bytes(), 0600); err != nil {
+	if err := os.WriteFile(filepath.Join(goBase, "interfaces_darwin.m"), buf.Bytes(), 0600); err != nil {
 		return err
 	}
 	return nil
@@ -256,7 +255,7 @@ func genJavaPackages(dir string, classes []*java.Class, embedders []importers.St
 		pkgFile := filepath.Join(pkgDir, "package.go")
 		buf.Reset()
 		cg.GenPackage(i)
-		if err := ioutil.WriteFile(pkgFile, buf.Bytes(), 0600); err != nil {
+		if err := os.WriteFile(pkgFile, buf.Bytes(), 0600); err != nil {
 			return err
 		}
 	}
@@ -266,7 +265,7 @@ func genJavaPackages(dir string, classes []*java.Class, embedders []importers.St
 	if err := os.MkdirAll(javaBase, 0700); err != nil {
 		return err
 	}
-	if err := ioutil.WriteFile(filepath.Join(javaBase, "interfaces.go"), buf.Bytes(), 0600); err != nil {
+	if err := os.WriteFile(filepath.Join(javaBase, "interfaces.go"), buf.Bytes(), 0600); err != nil {
 		return err
 	}
 	goBase := filepath.Join(dir, "src", "gobind")
@@ -275,17 +274,17 @@ func genJavaPackages(dir string, classes []*java.Class, embedders []importers.St
 	}
 	buf.Reset()
 	cg.GenGo()
-	if err := ioutil.WriteFile(filepath.Join(goBase, "classes_android.go"), buf.Bytes(), 0600); err != nil {
+	if err := os.WriteFile(filepath.Join(goBase, "classes_android.go"), buf.Bytes(), 0600); err != nil {
 		return err
 	}
 	buf.Reset()
 	cg.GenH()
-	if err := ioutil.WriteFile(filepath.Join(goBase, "classes.h"), buf.Bytes(), 0600); err != nil {
+	if err := os.WriteFile(filepath.Join(goBase, "classes.h"), buf.Bytes(), 0600); err != nil {
 		return err
 	}
 	buf.Reset()
 	cg.GenC()
-	if err := ioutil.WriteFile(filepath.Join(goBase, "classes_android.c"), buf.Bytes(), 0600); err != nil {
+	if err := os.WriteFile(filepath.Join(goBase, "classes_android.c"), buf.Bytes(), 0600); err != nil {
 		return err
 	}
 	return nil

+ 1 - 1
MobileLibrary/go-mobile/cmd/gobind/gobind_test.go

@@ -1,4 +1,4 @@
-// Copyright 2016 The Go Authors.  All rights reserved.
+// Copyright 2016 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 

+ 2 - 3
MobileLibrary/go-mobile/cmd/gobind/main.go

@@ -1,4 +1,4 @@
-// Copyright 2014 The Go Authors.  All rights reserved.
+// Copyright 2014 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
@@ -10,7 +10,6 @@ import (
 	"fmt"
 	"go/ast"
 	"go/types"
-	"io/ioutil"
 	"log"
 	"os"
 	"os/exec"
@@ -102,7 +101,7 @@ func run() {
 	if len(classes) > 0 || len(otypes) > 0 {
 		srcDir := *outdir
 		if srcDir == "" {
-			srcDir, err = ioutil.TempDir(os.TempDir(), "gobind-")
+			srcDir, err = os.MkdirTemp(os.TempDir(), "gobind-")
 			if err != nil {
 				log.Fatal(err)
 			}

+ 2 - 3
MobileLibrary/go-mobile/cmd/gomobile/bind.go

@@ -1,4 +1,4 @@
-// Copyright 2015 The Go Authors.  All rights reserved.
+// Copyright 2015 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
@@ -10,7 +10,6 @@ import (
 	"errors"
 	"fmt"
 	"io"
-	"io/ioutil"
 	"os"
 	"os/exec"
 	"path/filepath"
@@ -197,7 +196,7 @@ func writeFile(filename string, generate func(io.Writer) error) error {
 	}
 
 	if buildN {
-		return generate(ioutil.Discard)
+		return generate(io.Discard)
 	}
 
 	f, err := os.Create(filename)

+ 3 - 4
MobileLibrary/go-mobile/cmd/gomobile/bind_androidapp.go

@@ -1,4 +1,4 @@
-// Copyright 2015 The Go Authors.  All rights reserved.
+// Copyright 2015 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
@@ -8,7 +8,6 @@ import (
 	"archive/zip"
 	"fmt"
 	"io"
-	"io/ioutil"
 	"os"
 	"os/exec"
 	"path/filepath"
@@ -73,7 +72,7 @@ func goAndroidBind(gobind string, pkgs []*packages.Package, targets []targetInfo
 }
 
 func buildSrcJar(src string) error {
-	var out io.Writer = ioutil.Discard
+	var out io.Writer = io.Discard
 	if !buildN {
 		ext := filepath.Ext(buildO)
 		f, err := os.Create(buildO[:len(buildO)-len(ext)] + "-sources.jar")
@@ -110,7 +109,7 @@ func buildSrcJar(src string) error {
 //
 // javac and jar commands are needed to build classes.jar.
 func buildAAR(srcDir, androidDir string, pkgs []*packages.Package, targets []targetInfo) (err error) {
-	var out io.Writer = ioutil.Discard
+	var out io.Writer = io.Discard
 	if buildO == "" {
 		buildO = pkgs[0].Name + ".aar"
 	}

+ 1 - 1
MobileLibrary/go-mobile/cmd/gomobile/bind_iosapp.go

@@ -1,4 +1,4 @@
-// Copyright 2015 The Go Authors.  All rights reserved.
+// Copyright 2015 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 

+ 1 - 1
MobileLibrary/go-mobile/cmd/gomobile/bind_test.go

@@ -1,4 +1,4 @@
-// Copyright 2015 The Go Authors.  All rights reserved.
+// Copyright 2015 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 

+ 1 - 1
MobileLibrary/go-mobile/cmd/gomobile/build.go

@@ -1,4 +1,4 @@
-// Copyright 2015 The Go Authors.  All rights reserved.
+// Copyright 2015 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 

+ 3 - 4
MobileLibrary/go-mobile/cmd/gomobile/build_androidapp.go

@@ -1,4 +1,4 @@
-// Copyright 2015 The Go Authors.  All rights reserved.
+// Copyright 2015 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
@@ -13,7 +13,6 @@ import (
 	"errors"
 	"fmt"
 	"io"
-	"io/ioutil"
 	"log"
 	"os"
 	"path"
@@ -37,7 +36,7 @@ func goAndroidBuild(pkg *packages.Package, targets []targetInfo) (map[string]boo
 	dir := filepath.Dir(pkg.GoFiles[0])
 
 	manifestPath := filepath.Join(dir, "AndroidManifest.xml")
-	manifestData, err := ioutil.ReadFile(manifestPath)
+	manifestData, err := os.ReadFile(manifestPath)
 	if err != nil {
 		if !os.IsNotExist(err) {
 			return nil, err
@@ -129,7 +128,7 @@ func goAndroidBuild(pkg *packages.Package, targets []targetInfo) (map[string]boo
 			fmt.Fprintf(os.Stderr, "apk: %s\n", name)
 		}
 		if buildN {
-			return ioutil.Discard, nil
+			return io.Discard, nil
 		}
 		return apkw.Create(name)
 	}

+ 2 - 3
MobileLibrary/go-mobile/cmd/gomobile/build_apple.go

@@ -1,4 +1,4 @@
-// Copyright 2015 The Go Authors.  All rights reserved.
+// Copyright 2015 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
@@ -9,7 +9,6 @@ import (
 	"crypto/x509"
 	"encoding/pem"
 	"fmt"
-	"io/ioutil"
 	"os"
 	"os/exec"
 	"path"
@@ -69,7 +68,7 @@ func goAppleBuild(pkg *packages.Package, bundleID string, targets []targetInfo)
 			printcmd("echo \"%s\" > %s", file.contents, file.name)
 		}
 		if !buildN {
-			if err := ioutil.WriteFile(file.name, file.contents, 0644); err != nil {
+			if err := os.WriteFile(file.name, file.contents, 0644); err != nil {
 				return nil, err
 			}
 		}

+ 1 - 1
MobileLibrary/go-mobile/cmd/gomobile/build_darwin_test.go

@@ -1,4 +1,4 @@
-// Copyright 2015 The Go Authors.  All rights reserved.
+// Copyright 2015 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 

+ 2 - 3
MobileLibrary/go-mobile/cmd/gomobile/build_test.go

@@ -1,4 +1,4 @@
-// Copyright 2015 The Go Authors.  All rights reserved.
+// Copyright 2015 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
@@ -6,7 +6,6 @@ package main
 
 import (
 	"bytes"
-	"io/ioutil"
 	"os"
 	"os/exec"
 	"path/filepath"
@@ -212,7 +211,7 @@ func TestBuildWithGoModules(t *testing.T) {
 		t.Skipf("gomobile are not available on %s", runtime.GOOS)
 	}
 
-	dir, err := ioutil.TempDir("", "gomobile-test")
+	dir, err := os.MkdirTemp("", "gomobile-test")
 	if err != nil {
 		t.Fatal(err)
 	}

+ 1 - 1
MobileLibrary/go-mobile/cmd/gomobile/cert.go

@@ -1,4 +1,4 @@
-// Copyright 2015 The Go Authors.  All rights reserved.
+// Copyright 2015 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 

+ 2 - 3
MobileLibrary/go-mobile/cmd/gomobile/cert_test.go

@@ -1,4 +1,4 @@
-// Copyright 2015 The Go Authors.  All rights reserved.
+// Copyright 2015 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
@@ -8,7 +8,6 @@ import (
 	"crypto/rand"
 	"crypto/x509"
 	"encoding/pem"
-	"io/ioutil"
 	"os"
 	"os/exec"
 	"testing"
@@ -30,7 +29,7 @@ func TestSignPKCS7(t *testing.T) {
 	if err != nil {
 		t.Fatal(err)
 	}
-	sig, err := ioutil.TempFile("", "content.rsa")
+	sig, err := os.CreateTemp("", "content.rsa")
 	if err != nil {
 		t.Fatal(err)
 	}

+ 1 - 1
MobileLibrary/go-mobile/cmd/gomobile/clean.go

@@ -1,4 +1,4 @@
-// Copyright 2015 The Go Authors.  All rights reserved.
+// Copyright 2015 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 

+ 1 - 1
MobileLibrary/go-mobile/cmd/gomobile/dex.go

@@ -1,4 +1,4 @@
-// Copyright 2015 The Go Authors.  All rights reserved.
+// Copyright 2015 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 

+ 2 - 2
MobileLibrary/go-mobile/cmd/gomobile/doc.go

@@ -1,4 +1,4 @@
-// Copyright 2015 The Go Authors.  All rights reserved.
+// Copyright 2015 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
@@ -167,4 +167,4 @@ Usage:
 
 Version prints versions of the gomobile binary and tools
 */
-package main // import "golang.org/x/mobile/cmd/gomobile"
+package main

+ 31 - 26
MobileLibrary/go-mobile/cmd/gomobile/env.go

@@ -1,3 +1,7 @@
+// Copyright 2015 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
 package main
 
 import (
@@ -6,7 +10,6 @@ import (
 	"errors"
 	"fmt"
 	"io/fs"
-	"io/ioutil"
 	"os"
 	"os/exec"
 	"path/filepath"
@@ -63,9 +66,11 @@ func platformOS(platform string) string {
 	case "macos", "maccatalyst":
 		// For "maccatalyst", Go packages should be built with GOOS=darwin,
 		// not GOOS=ios, since the underlying OS (and kernel, runtime) is macOS.
+		// But, using GOOS=darwin with build-tag ios leads to corrupt builds: https://go.dev/issue/52299
+		// => So we use GOOS=ios for now.
 		// We also apply a "macos" or "maccatalyst" build tag, respectively.
 		// See below for additional context.
-		return "darwin"
+		return "ios"
 	default:
 		panic(fmt.Sprintf("unexpected platform: %s", platform))
 	}
@@ -82,17 +87,17 @@ func platformTags(platform string) []string {
 	case "maccatalyst":
 		// Mac Catalyst is a subset of iOS APIs made available on macOS
 		// designed to ease porting apps developed for iPad to macOS.
-		// See https://developer.apple.com/mac-catalyst/.
-		// Because of this, when building a Go package targeting maccatalyst,
-		// GOOS=darwin (not ios). To bridge the gap and enable maccatalyst
-		// packages to be compiled, we also specify the "ios" build tag.
+		// See
+		//   https://developer.apple.com/mac-catalyst/.
+		//   https://stackoverflow.com/questions/12132933/preprocessor-macro-for-os-x-targets/49560690#49560690
+		//
+		// Historically gomobile used GOOS=darwin with build tag ios when
+		// targeting Mac Catalyst. However, this configuration is not officially
+		// supported and leads to corrupt builds after go1.18: https://go.dev/issues/52299
+		// Use GOOS=ios.
 		// To help discriminate between darwin, ios, macos, and maccatalyst
 		// targets, there is also a "maccatalyst" tag.
-		// Some additional context on this can be found here:
-		// https://stackoverflow.com/questions/12132933/preprocessor-macro-for-os-x-targets/49560690#49560690
-		// TODO(ydnar): remove tag "ios" when cgo supports Catalyst
-		// See golang.org/issues/47228
-		return []string{"ios", "macos", "maccatalyst"}
+		return []string{"macos", "maccatalyst"}
 	default:
 		panic(fmt.Sprintf("unexpected platform: %s", platform))
 	}
@@ -138,7 +143,7 @@ func buildEnvInit() (cleanup func(), err error) {
 		tmpdir = "$WORK"
 		cleanupFn = func() {}
 	} else {
-		tmpdir, err = ioutil.TempDir("", "gomobile-work-")
+		tmpdir, err = os.MkdirTemp("", "gomobile-work-")
 		if err != nil {
 			return nil, err
 		}
@@ -217,17 +222,11 @@ func envInit() (err error) {
 				cflags += " -mios-simulator-version-min=" + buildIOSVersion
 				cflags += " -fembed-bitcode"
 			case "maccatalyst":
-				// Mac Catalyst is a subset of iOS APIs made available on macOS
-				// designed to ease porting apps developed for iPad to macOS.
-				// See https://developer.apple.com/mac-catalyst/.
-				// Because of this, when building a Go package targeting maccatalyst,
-				// GOOS=darwin (not ios). To bridge the gap and enable maccatalyst
-				// packages to be compiled, we also specify the "ios" build tag.
-				// To help discriminate between darwin, ios, macos, and maccatalyst
-				// targets, there is also a "maccatalyst" tag.
-				// Some additional context on this can be found here:
-				// https://stackoverflow.com/questions/12132933/preprocessor-macro-for-os-x-targets/49560690#49560690
-				goos = "darwin"
+				// See the comment about maccatalyst's GOOS, build tags configuration
+				// in platformOS and platformTags.
+				// Using GOOS=darwin with build-tag ios leads to corrupt builds: https://go.dev/issue/52299
+				// => So we use GOOS=ios for now.
+				goos = "ios"
 				sdk = "macosx"
 				clang, cflags, err = envClang(sdk)
 				// TODO(ydnar): the following 3 lines MAY be needed to compile
@@ -340,7 +339,7 @@ func checkNDKRoot(ndkRoot string, targets []targetInfo) error {
 
 // compatibleNDKRoots searches the side-by-side NDK dirs for compatible SDKs.
 func compatibleNDKRoots(ndkForest string, targets []targetInfo) ([]string, error) {
-	ndkDirs, err := ioutil.ReadDir(ndkForest)
+	ndkDirs, err := os.ReadDir(ndkForest)
 	if err != nil {
 		return nil, err
 	}
@@ -436,15 +435,21 @@ func envClang(sdkName string) (clang, cflags string, err error) {
 		return sdkName + "-clang", "-isysroot " + sdkName, nil
 	}
 	cmd := exec.Command("xcrun", "--sdk", sdkName, "--find", "clang")
-	out, err := cmd.CombinedOutput()
+	out, err := cmd.Output()
 	if err != nil {
+		if ee := (*exec.ExitError)(nil); errors.As(err, &ee) {
+			out = append(out, ee.Stderr...)
+		}
 		return "", "", fmt.Errorf("xcrun --find: %v\n%s", err, out)
 	}
 	clang = strings.TrimSpace(string(out))
 
 	cmd = exec.Command("xcrun", "--sdk", sdkName, "--show-sdk-path")
-	out, err = cmd.CombinedOutput()
+	out, err = cmd.Output()
 	if err != nil {
+		if ee := (*exec.ExitError)(nil); errors.As(err, &ee) {
+			out = append(out, ee.Stderr...)
+		}
 		return "", "", fmt.Errorf("xcrun --show-sdk-path: %v\n%s", err, out)
 	}
 	sdk := strings.TrimSpace(string(out))

+ 2 - 3
MobileLibrary/go-mobile/cmd/gomobile/env_test.go

@@ -1,4 +1,4 @@
-// Copyright 2019 The Go Authors.  All rights reserved.
+// Copyright 2019 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
@@ -6,14 +6,13 @@ package main
 
 import (
 	"fmt"
-	"io/ioutil"
 	"os"
 	"path/filepath"
 	"testing"
 )
 
 func TestNdkRoot(t *testing.T) {
-	home, err := ioutil.TempDir("", "gomobile-test-")
+	home, err := os.MkdirTemp("", "gomobile-test-")
 	if err != nil {
 		t.Fatal(err)
 	}

+ 4 - 5
MobileLibrary/go-mobile/cmd/gomobile/gendex.go

@@ -1,4 +1,4 @@
-// Copyright 2015 The Go Authors.  All rights reserved.
+// Copyright 2015 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
@@ -23,7 +23,6 @@ import (
 	"flag"
 	"fmt"
 	"go/format"
-	"io/ioutil"
 	"log"
 	"os"
 	"os/exec"
@@ -40,7 +39,7 @@ func main() {
 	flag.Parse()
 
 	var err error
-	tmpdir, err = ioutil.TempDir("", "gendex-")
+	tmpdir, err = os.MkdirTemp("", "gendex-")
 	if err != nil {
 		log.Fatal(err)
 	}
@@ -98,7 +97,7 @@ func gendex() error {
 		os.Stderr.Write(out)
 		return err
 	}
-	src, err := ioutil.ReadFile(tmpdir + "/classes.dex")
+	src, err := os.ReadFile(tmpdir + "/classes.dex")
 	if err != nil {
 		return err
 	}
@@ -148,7 +147,7 @@ func findLast(path string) (string, error) {
 	return path + "/" + children[len(children)-1], nil
 }
 
-var header = `// Copyright 2015 The Go Authors.  All rights reserved.
+var header = `// Copyright 2015 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 

+ 3 - 4
MobileLibrary/go-mobile/cmd/gomobile/init.go

@@ -1,4 +1,4 @@
-// Copyright 2015 The Go Authors.  All rights reserved.
+// Copyright 2015 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
@@ -9,7 +9,6 @@ import (
 	"errors"
 	"fmt"
 	"io"
-	"io/ioutil"
 	"os"
 	"os/exec"
 	"path/filepath"
@@ -63,7 +62,7 @@ func runInit(cmd *command) error {
 		tmpdir = filepath.Join(gomobilepath, "work")
 	} else {
 		var err error
-		tmpdir, err = ioutil.TempDir(gomobilepath, "work-")
+		tmpdir, err = os.MkdirTemp(gomobilepath, "work-")
 		if err != nil {
 			return err
 		}
@@ -153,7 +152,7 @@ func installOpenAL(gomobilepath string) error {
 		alTmpDir = filepath.Join(gomobilepath, "work")
 	} else {
 		var err error
-		alTmpDir, err = ioutil.TempDir(gomobilepath, "openal-release-")
+		alTmpDir, err = os.MkdirTemp(gomobilepath, "openal-release-")
 		if err != nil {
 			return err
 		}

+ 3 - 4
MobileLibrary/go-mobile/cmd/gomobile/init_test.go

@@ -1,4 +1,4 @@
-// Copyright 2015 The Go Authors.  All rights reserved.
+// Copyright 2015 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
@@ -6,7 +6,6 @@ package main
 
 import (
 	"bytes"
-	"io/ioutil"
 	"os"
 	"os/exec"
 	"path/filepath"
@@ -40,7 +39,7 @@ func TestInit(t *testing.T) {
 
 	// Test that first GOPATH element is chosen correctly.
 	var err error
-	gopath, err = ioutil.TempDir("", "gomobile-test")
+	gopath, err = os.MkdirTemp("", "gomobile-test")
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -55,7 +54,7 @@ func TestInit(t *testing.T) {
 		os.Setenv("HOMEDRIVE", "C:")
 	}
 
-	emptymod, err := ioutil.TempDir("", "gomobile-test")
+	emptymod, err := os.MkdirTemp("", "gomobile-test")
 	if err != nil {
 		t.Fatal(err)
 	}

+ 1 - 1
MobileLibrary/go-mobile/cmd/gomobile/install.go

@@ -1,4 +1,4 @@
-// Copyright 2015 The Go Authors.  All rights reserved.
+// Copyright 2015 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 

+ 3 - 4
MobileLibrary/go-mobile/cmd/gomobile/main.go

@@ -1,4 +1,4 @@
-// Copyright 2015 The Go Authors.  All rights reserved.
+// Copyright 2015 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
@@ -13,7 +13,6 @@ import (
 	"fmt"
 	"html/template"
 	"io"
-	"io/ioutil"
 	"log"
 	"os"
 	"os/exec"
@@ -128,7 +127,7 @@ func help(args []string) {
 	os.Exit(2)
 }
 
-const documentationHeader = `// Copyright 2015 The Go Authors.  All rights reserved.
+const documentationHeader = `// Copyright 2015 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
@@ -159,7 +158,7 @@ func helpDocumentation(path string) {
 
 	w.WriteString("*/\npackage main // import \"golang.org/x/mobile/cmd/gomobile\"\n")
 
-	if err := ioutil.WriteFile(path, w.Bytes(), 0666); err != nil {
+	if err := os.WriteFile(path, w.Bytes(), 0666); err != nil {
 		log.Fatal(err)
 	}
 }

+ 1 - 1
MobileLibrary/go-mobile/cmd/gomobile/manifest.go

@@ -1,4 +1,4 @@
-// Copyright 2015 The Go Authors.  All rights reserved.
+// Copyright 2015 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 

+ 1 - 1
MobileLibrary/go-mobile/cmd/gomobile/strings_flag.go

@@ -1,4 +1,4 @@
-// Copyright 2015 The Go Authors.  All rights reserved.
+// Copyright 2015 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 

+ 1 - 1
MobileLibrary/go-mobile/cmd/gomobile/version.go

@@ -1,4 +1,4 @@
-// Copyright 2015 The Go Authors.  All rights reserved.
+// Copyright 2015 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 

+ 1 - 1
MobileLibrary/go-mobile/cmd/gomobile/writer.go

@@ -1,4 +1,4 @@
-// Copyright 2015 The Go Authors.  All rights reserved.
+// Copyright 2015 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 

+ 3 - 4
MobileLibrary/go-mobile/cmd/gomobile/writer_test.go

@@ -1,4 +1,4 @@
-// Copyright 2015 The Go Authors.  All rights reserved.
+// Copyright 2015 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
@@ -8,7 +8,6 @@ import (
 	"crypto/x509"
 	"encoding/pem"
 	"io"
-	"io/ioutil"
 	"os"
 	"os/exec"
 	"testing"
@@ -28,7 +27,7 @@ func TestWriter(t *testing.T) {
 		t.Fatal(err)
 	}
 
-	f, err := ioutil.TempFile("", "testapk-")
+	f, err := os.CreateTemp("", "testapk-")
 	if err != nil {
 		t.Fatal(err)
 	}
@@ -141,7 +140,7 @@ const androidManifest = `
 `
 
 func writeTempFile(data string) (string, error) {
-	f, err := ioutil.TempFile("", "gofmt")
+	f, err := os.CreateTemp("", "gofmt")
 	if err != nil {
 		return "", err
 	}

+ 1 - 1
MobileLibrary/go-mobile/event/lifecycle/lifecycle.go

@@ -17,7 +17,7 @@
 // means it has lost the focus.
 //
 // See the golang.org/x/mobile/app package for details on the event model.
-package lifecycle // import "golang.org/x/mobile/event/lifecycle"
+package lifecycle
 
 import (
 	"fmt"

+ 1 - 1
MobileLibrary/go-mobile/event/mouse/mouse.go

@@ -5,7 +5,7 @@
 // Package mouse defines an event for mouse input.
 //
 // See the golang.org/x/mobile/app package for details on the event model.
-package mouse // import "golang.org/x/mobile/event/mouse"
+package mouse
 
 import (
 	"fmt"

+ 1 - 1
MobileLibrary/go-mobile/event/paint/paint.go

@@ -5,7 +5,7 @@
 // Package paint defines an event for the app being ready to paint.
 //
 // See the golang.org/x/mobile/app package for details on the event model.
-package paint // import "golang.org/x/mobile/event/paint"
+package paint
 
 // Event indicates that the app is ready to paint the next frame of the GUI.
 //

+ 1 - 1
MobileLibrary/go-mobile/event/size/size.go

@@ -6,7 +6,7 @@
 // orientation of the app's window.
 //
 // See the golang.org/x/mobile/app package for details on the event model.
-package size // import "golang.org/x/mobile/event/size"
+package size
 
 import (
 	"image"

+ 1 - 1
MobileLibrary/go-mobile/event/touch/touch.go

@@ -5,7 +5,7 @@
 // Package touch defines an event for touch input.
 //
 // See the golang.org/x/mobile/app package for details on the event model.
-package touch // import "golang.org/x/mobile/event/touch"
+package touch
 
 // The best source on android input events is the NDK: include/android/input.h
 //

+ 1 - 1
MobileLibrary/go-mobile/example/ivy/doc.go

@@ -1,4 +1,4 @@
-// Copyright 2021 The Go Authors.  All rights reserved.
+// Copyright 2021 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 

+ 1 - 1
MobileLibrary/go-mobile/example/ivy/go.mod

@@ -1,6 +1,6 @@
 module golang.org/x/mobile/example/ivy
 
-go 1.17
+go 1.23.0
 
 require (
 	golang.org/x/mobile v0.0.0-20210924032853-1c027f395ef7

+ 2 - 2
MobileLibrary/go-mobile/example/ivy/tools.go

@@ -1,8 +1,8 @@
-// Copyright 2021 The Go Authors.  All rights reserved.
+// Copyright 2021 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
-//go:build ignore
+//go:build tools
 
 package dummy
 

+ 1 - 1
MobileLibrary/go-mobile/exp/app/debug/fps.go

@@ -5,7 +5,7 @@
 //go:build darwin || linux || windows
 
 // Package debug provides GL-based debugging tools for apps.
-package debug // import "golang.org/x/mobile/exp/app/debug"
+package debug
 
 import (
 	"image"

+ 1 - 1
MobileLibrary/go-mobile/exp/audio/al/al.go

@@ -22,7 +22,7 @@
 // license file to the open source notices of your application.
 // OpenAL Soft's license file could be found at
 // http://repo.or.cz/w/openal-soft.git/blob/HEAD:/COPYING.
-package al // import "golang.org/x/mobile/exp/audio/al"
+package al
 
 // Capability represents OpenAL extension capabilities.
 type Capability int32

+ 4 - 0
MobileLibrary/go-mobile/exp/f32/affine_test.go

@@ -1,3 +1,7 @@
+// Copyright 2014 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
 package f32
 
 import (

+ 1 - 1
MobileLibrary/go-mobile/exp/f32/f32.go

@@ -23,7 +23,7 @@
 // The interface to this package is not stable. It will change considerably.
 // Only use functions that provide package documentation. Semantics are
 // non-obvious. Be prepared for the package name to change.
-package f32 // import "golang.org/x/mobile/exp/f32"
+package f32
 
 import (
 	"encoding/binary"

+ 2 - 2
MobileLibrary/go-mobile/exp/f32/gen.go

@@ -16,9 +16,9 @@ import (
 	"flag"
 	"fmt"
 	"go/format"
-	"io/ioutil"
 	"log"
 	"math"
+	"os"
 )
 
 // N is the number of entries in the sin look-up table. It must be a power of 2.
@@ -42,7 +42,7 @@ func main() {
 	if err != nil {
 		log.Fatal(err)
 	}
-	if err := ioutil.WriteFile(*filename, data, 0644); err != nil {
+	if err := os.WriteFile(*filename, data, 0644); err != nil {
 		log.Fatal(err)
 	}
 }

+ 1 - 1
MobileLibrary/go-mobile/exp/font/doc.go

@@ -3,4 +3,4 @@
 // license that can be found in the LICENSE file.
 
 // Package font provides platform independent access to system fonts.
-package font // import "golang.org/x/mobile/exp/font"
+package font

+ 3 - 3
MobileLibrary/go-mobile/exp/font/font_android.go

@@ -4,12 +4,12 @@
 
 package font
 
-import "io/ioutil"
+import "os"
 
 func buildDefault() ([]byte, error) {
-	return ioutil.ReadFile("/system/fonts/DroidSans.ttf")
+	return os.ReadFile("/system/fonts/DroidSans.ttf")
 }
 
 func buildMonospace() ([]byte, error) {
-	return ioutil.ReadFile("/system/fonts/DroidSansMono.ttf")
+	return os.ReadFile("/system/fonts/DroidSansMono.ttf")
 }

+ 5 - 5
MobileLibrary/go-mobile/exp/font/font_linux.go

@@ -6,13 +6,13 @@
 
 package font
 
-import "io/ioutil"
+import "os"
 
 func buildDefault() ([]byte, error) {
 	// Try Noto first, but fall back to Droid as the latter was deprecated
-	noto, nerr := ioutil.ReadFile("/usr/share/fonts/truetype/noto/NotoSans-Regular.ttf")
+	noto, nerr := os.ReadFile("/usr/share/fonts/truetype/noto/NotoSans-Regular.ttf")
 	if nerr != nil {
-		if droid, err := ioutil.ReadFile("/usr/share/fonts/truetype/droid/DroidSans.ttf"); err == nil {
+		if droid, err := os.ReadFile("/usr/share/fonts/truetype/droid/DroidSans.ttf"); err == nil {
 			return droid, nil
 		}
 	}
@@ -21,9 +21,9 @@ func buildDefault() ([]byte, error) {
 
 func buildMonospace() ([]byte, error) {
 	// Try Noto first, but fall back to Droid as the latter was deprecated
-	noto, nerr := ioutil.ReadFile("/usr/share/fonts/truetype/noto/NotoMono-Regular.ttf")
+	noto, nerr := os.ReadFile("/usr/share/fonts/truetype/noto/NotoMono-Regular.ttf")
 	if nerr != nil {
-		if droid, err := ioutil.ReadFile("/usr/share/fonts/truetype/droid/DroidSansMono.ttf"); err == nil {
+		if droid, err := os.ReadFile("/usr/share/fonts/truetype/droid/DroidSansMono.ttf"); err == nil {
 			return droid, nil
 		}
 	}

+ 1 - 1
MobileLibrary/go-mobile/exp/gl/glutil/doc.go

@@ -3,4 +3,4 @@
 // license that can be found in the LICENSE file.
 
 // Package glutil implements OpenGL utility functions.
-package glutil // import "golang.org/x/mobile/exp/gl/glutil"
+package glutil

+ 1 - 1
MobileLibrary/go-mobile/exp/gl/glutil/glutil.go

@@ -4,7 +4,7 @@
 
 //go:build darwin || linux || windows
 
-package glutil // import "golang.org/x/mobile/exp/gl/glutil"
+package glutil
 
 import (
 	"fmt"

+ 1 - 1
MobileLibrary/go-mobile/exp/sensor/sensor.go

@@ -3,7 +3,7 @@
 // license that can be found in the LICENSE file.
 
 // Package sensor provides sensor events from various movement sensors.
-package sensor // import "golang.org/x/mobile/exp/sensor"
+package sensor
 
 import (
 	"errors"

+ 1 - 1
MobileLibrary/go-mobile/exp/sprite/clock/clock.go

@@ -3,7 +3,7 @@
 // license that can be found in the LICENSE file.
 
 // Package clock provides a clock and time functions for a sprite engine.
-package clock // import "golang.org/x/mobile/exp/sprite/clock"
+package clock
 
 // A Time represents an instant in sprite time.
 //

+ 1 - 1
MobileLibrary/go-mobile/exp/sprite/glsprite/glsprite.go

@@ -8,7 +8,7 @@
 //
 // Each sprite.Texture is loaded as a GL texture object and drawn
 // to the screen via an affine transform done in a simple shader.
-package glsprite // import "golang.org/x/mobile/exp/sprite/glsprite"
+package glsprite
 
 import (
 	"image"

+ 1 - 2
MobileLibrary/go-mobile/exp/sprite/portable/affine_test.go

@@ -9,7 +9,6 @@ import (
 	"image/color"
 	"image/draw"
 	"image/png"
-	"io/ioutil"
 	"math"
 	"os"
 	"runtime"
@@ -147,7 +146,7 @@ func TestAffineMask(t *testing.T) {
 }
 
 func writeTempPNG(prefix string, m image.Image) (string, error) {
-	f, err := ioutil.TempFile("", prefix+"-")
+	f, err := os.CreateTemp("", prefix+"-")
 	if err != nil {
 		return "", err
 	}

+ 1 - 1
MobileLibrary/go-mobile/exp/sprite/portable/portable.go

@@ -7,7 +7,7 @@
 // It is intended to serve as a reference implementation for testing
 // other sprite Engines written against OpenGL, or other more exotic
 // modern hardware interfaces.
-package portable // import "golang.org/x/mobile/exp/sprite/portable"
+package portable
 
 import (
 	"image"

+ 1 - 1
MobileLibrary/go-mobile/exp/sprite/sprite.go

@@ -22,7 +22,7 @@
 //		modify the scene's nodes and animations (Arranger values)
 //		e.Render(scene, t, sz)
 //	}
-package sprite // import "golang.org/x/mobile/exp/sprite"
+package sprite
 
 import (
 	"image"

+ 1 - 1
MobileLibrary/go-mobile/geom/geom.go

@@ -19,7 +19,7 @@ the screen. Positions on the plane are measured in typographic points,
 Any interface that draws to the screen using types from the geom package
 scales the number of pixels to maintain a Pt as 1/72 of an inch.
 */
-package geom // import "golang.org/x/mobile/geom"
+package geom
 
 /*
 Notes on the various underlying coordinate systems.

+ 1 - 1
MobileLibrary/go-mobile/gl/consts.go

@@ -1,4 +1,4 @@
-// Copyright 2014 The Go Authors.  All rights reserved.
+// Copyright 2014 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 

+ 8 - 9
MobileLibrary/go-mobile/gl/dll_windows.go

@@ -10,7 +10,6 @@ import (
 	"debug/pe"
 	"fmt"
 	"io"
-	"io/ioutil"
 	"log"
 	"net/http"
 	"os"
@@ -18,7 +17,7 @@ import (
 	"runtime"
 )
 
-var debug = log.New(ioutil.Discard, "gl: ", log.LstdFlags)
+var debug = log.New(io.Discard, "gl: ", log.LstdFlags)
 
 func downloadDLLs() (path string, err error) {
 	url := "https://dl.google.com/go/mobile/angle-bd3f8780b-" + runtime.GOARCH + ".tgz"
@@ -54,11 +53,11 @@ func downloadDLLs() (path string, err error) {
 		}
 		switch header.Name {
 		case "angle-" + runtime.GOARCH + "/libglesv2.dll":
-			bytesGLESv2, err = ioutil.ReadAll(tr)
+			bytesGLESv2, err = io.ReadAll(tr)
 		case "angle-" + runtime.GOARCH + "/libegl.dll":
-			bytesEGL, err = ioutil.ReadAll(tr)
+			bytesEGL, err = io.ReadAll(tr)
 		case "angle-" + runtime.GOARCH + "/d3dcompiler_47.dll":
-			bytesD3DCompiler, err = ioutil.ReadAll(tr)
+			bytesD3DCompiler, err = io.ReadAll(tr)
 		default: // skip
 		}
 		if err != nil {
@@ -70,13 +69,13 @@ func downloadDLLs() (path string, err error) {
 	}
 
 	writeDLLs := func(path string) error {
-		if err := ioutil.WriteFile(filepath.Join(path, "libglesv2.dll"), bytesGLESv2, 0755); err != nil {
+		if err := os.WriteFile(filepath.Join(path, "libglesv2.dll"), bytesGLESv2, 0755); err != nil {
 			return fmt.Errorf("gl: cannot install ANGLE: %v", err)
 		}
-		if err := ioutil.WriteFile(filepath.Join(path, "libegl.dll"), bytesEGL, 0755); err != nil {
+		if err := os.WriteFile(filepath.Join(path, "libegl.dll"), bytesEGL, 0755); err != nil {
 			return fmt.Errorf("gl: cannot install ANGLE: %v", err)
 		}
-		if err := ioutil.WriteFile(filepath.Join(path, "d3dcompiler_47.dll"), bytesD3DCompiler, 0755); err != nil {
+		if err := os.WriteFile(filepath.Join(path, "d3dcompiler_47.dll"), bytesD3DCompiler, 0755); err != nil {
 			return fmt.Errorf("gl: cannot install ANGLE: %v", err)
 		}
 		return nil
@@ -152,7 +151,7 @@ func chromePath() string {
 	}
 
 	for _, installdir := range installdirs {
-		versiondirs, err := ioutil.ReadDir(installdir)
+		versiondirs, err := os.ReadDir(installdir)
 		if err != nil {
 			continue
 		}

+ 2 - 2
MobileLibrary/go-mobile/gl/doc.go

@@ -1,4 +1,4 @@
-// Copyright 2014 The Go Authors.  All rights reserved.
+// Copyright 2014 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
@@ -42,7 +42,7 @@ error messages. For example,
 The gldebug tracing has very high overhead, so make sure to remove
 the build tag before deploying any binaries.
 */
-package gl // import "golang.org/x/mobile/gl"
+package gl
 
 /*
 Implementation details.

+ 1 - 1
MobileLibrary/go-mobile/gl/fn.go

@@ -1,4 +1,4 @@
-// Copyright 2015 The Go Authors.  All rights reserved.
+// Copyright 2015 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 

+ 3 - 4
MobileLibrary/go-mobile/gl/gendebug.go

@@ -1,4 +1,4 @@
-// Copyright 2014 The Go Authors.  All rights reserved.
+// Copyright 2014 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
@@ -18,7 +18,6 @@ import (
 	"go/parser"
 	"go/printer"
 	"go/token"
-	"io/ioutil"
 	"log"
 	"os"
 	"strconv"
@@ -835,7 +834,7 @@ func main() {
 		os.Stdout.Write(b)
 		return
 	}
-	if err := ioutil.WriteFile(*outfile, b, 0666); err != nil {
+	if err := os.WriteFile(*outfile, b, 0666); err != nil {
 		die(err)
 	}
 }
@@ -877,7 +876,7 @@ func setEnqueueBlocking(c *ast.CallExpr) {
 	})
 }
 
-const preamble = `// Copyright 2014 The Go Authors.  All rights reserved.
+const preamble = `// Copyright 2014 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 

+ 1 - 1
MobileLibrary/go-mobile/gl/gl.go

@@ -1,4 +1,4 @@
-// Copyright 2014 The Go Authors.  All rights reserved.
+// Copyright 2014 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 

+ 1 - 1
MobileLibrary/go-mobile/gl/gldebug.go

@@ -1,4 +1,4 @@
-// Copyright 2014 The Go Authors.  All rights reserved.
+// Copyright 2014 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 

+ 5 - 5
MobileLibrary/go-mobile/gl/interface.go

@@ -1,4 +1,4 @@
-// Copyright 2014 The Go Authors.  All rights reserved.
+// Copyright 2014 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 
@@ -81,7 +81,7 @@ type Context interface {
 	// http://www.khronos.org/opengles/sdk/docs/man3/html/glBlendFunc.xhtml
 	BlendFunc(sfactor, dfactor Enum)
 
-	// BlendFunc sets the pixel RGB and alpha blending factors separately.
+	// BlendFuncSeparate sets the pixel RGB and alpha blending factors separately.
 	//
 	// http://www.khronos.org/opengles/sdk/docs/man3/html/glBlendFuncSeparate.xhtml
 	BlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha Enum)
@@ -192,7 +192,7 @@ type Context interface {
 	// http://www.khronos.org/opengles/sdk/docs/man3/html/glGenTextures.xhtml
 	CreateTexture() Texture
 
-	// CreateTVertexArray creates a vertex array.
+	// CreateVertexArray creates a vertex array.
 	//
 	// http://www.khronos.org/opengles/sdk/docs/man3/html/glGenVertexArrays.xhtml
 	CreateVertexArray() VertexArray
@@ -599,7 +599,7 @@ type Context interface {
 	// http://www.khronos.org/opengles/sdk/docs/man3/html/glStencilFunc.xhtml
 	StencilFunc(fn Enum, ref int, mask uint32)
 
-	// StencilFunc sets the front or back stencil test reference value.
+	// StencilFuncSeparate sets the front or back stencil test reference value.
 	//
 	// http://www.khronos.org/opengles/sdk/docs/man3/html/glStencilFuncSeparate.xhtml
 	StencilFuncSeparate(face, fn Enum, ref int, mask uint32)
@@ -737,7 +737,7 @@ type Context interface {
 	// http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml
 	Uniform4i(dst Uniform, v0, v1, v2, v3 int32)
 
-	// Uniform4i writes an ivec4 uniform array of len(src)/4 elements.
+	// Uniform4iv writes an ivec4 uniform array of len(src)/4 elements.
 	//
 	// http://www.khronos.org/opengles/sdk/docs/man3/html/glUniform.xhtml
 	Uniform4iv(dst Uniform, src []int32)

+ 1 - 1
MobileLibrary/go-mobile/gl/types_debug.go

@@ -1,4 +1,4 @@
-// Copyright 2014 The Go Authors.  All rights reserved.
+// Copyright 2014 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 

+ 1 - 1
MobileLibrary/go-mobile/gl/types_prod.go

@@ -1,4 +1,4 @@
-// Copyright 2014 The Go Authors.  All rights reserved.
+// Copyright 2014 The Go Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style
 // license that can be found in the LICENSE file.
 

+ 1 - 1
MobileLibrary/go-mobile/gl/work.go

@@ -160,7 +160,7 @@ func (ctx *context) cString(str string) (uintptr, func()) {
 	return uintptr(ptr), func() { C.free(ptr) }
 }
 
-// cString creates a pointer to a C string off the Go heap.
+// cStringPtr creates a pointer to a C string off the Go heap.
 // ret is a **char.
 func (ctx *context) cStringPtr(str string) (uintptr, func()) {
 	s, free := ctx.cString(str)

Unele fișiere nu au fost afișate deoarece prea multe fișiere au fost modificate în acest diff