Skip to content

Commit

Permalink
Support purego build tag (#68)
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
dsnet committed Feb 2, 2018
1 parent 97aa668 commit 3af367b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmp/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion cmp/unsafe_panic.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion cmp/unsafe_reflect.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 3af367b

Please sign in to comment.