aboutsummaryrefslogtreecommitdiff
path: root/cmp
diff options
context:
space:
mode:
authorJoe Tsai <joetsai@digital-static.net>2018-02-02 13:19:42 -0800
committerGitHub <noreply@github.com>2018-02-02 13:19:42 -0800
commit3af367b6b30c263d47e8895973edcca9a49cf029 (patch)
tree7093243ba9125815da1fb1b40532dba994eb7cb5 /cmp
parent97aa668b73e764ccdd786bc3ccd2edffe621150e (diff)
downloadgo-cmp-3af367b6b30c263d47e8895973edcca9a49cf029.tar.gz
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).
Diffstat (limited to 'cmp')
-rw-r--r--cmp/options.go2
-rw-r--r--cmp/unsafe_panic.go2
-rw-r--r--cmp/unsafe_reflect.go2
3 files changed, 3 insertions, 3 deletions
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 @@ func (cm comparer) String() string {
// 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