Support purego build tag (#68)
The proposal in golang/go#23172 was accepted. The "purego" build tag
is intended to be a community agreed upon soft-signal to indicate the
forbidden use of unsafe, assembly, or cgo.
A change in the future will remove special-casing the appengine and js tags
once the related toolchains support purego (possibly after some bake-in period).
diff --git a/cmp/options.go b/cmp/options.go
index 885efc8..91d4b06 100644
--- a/cmp/options.go
+++ b/cmp/options.go
@@ -355,7 +355,7 @@
// all unexported fields on specified struct types.
func AllowUnexported(types ...interface{}) Option {
if !supportAllowUnexported {
- panic("AllowUnexported is not supported on App Engine Classic or GopherJS")
+ panic("AllowUnexported is not supported on purego builds, Google App Engine Standard, or GopherJS")
}
m := make(map[reflect.Type]bool)
for _, typ := range types {
diff --git a/cmp/unsafe_panic.go b/cmp/unsafe_panic.go
index 0d44987..d1518eb 100644
--- a/cmp/unsafe_panic.go
+++ b/cmp/unsafe_panic.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE.md file.
-// +build appengine js
+// +build purego appengine js
package cmp
diff --git a/cmp/unsafe_reflect.go b/cmp/unsafe_reflect.go
index 81fb826..579b655 100644
--- a/cmp/unsafe_reflect.go
+++ b/cmp/unsafe_reflect.go
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE.md file.
-// +build !appengine,!js
+// +build !purego,!appengine,!js
package cmp