瀏覽代碼

proto: support purego build tag

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).
Joe Tsai 8 年之前
父節點
當前提交
9a84eb8532
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      proto/pointer_reflect.go
  2. 1 1
      proto/pointer_unsafe.go

+ 1 - 1
proto/pointer_reflect.go

@@ -29,7 +29,7 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
-// +build appengine js
+// +build purego appengine js
 
 
 // This file contains an implementation of proto field accesses using package reflect.
 // This file contains an implementation of proto field accesses using package reflect.
 // It is slower than the code in pointer_unsafe.go but it avoids package unsafe and can
 // It is slower than the code in pointer_unsafe.go but it avoids package unsafe and can

+ 1 - 1
proto/pointer_unsafe.go

@@ -29,7 +29,7 @@
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 
 
-// +build !appengine,!js
+// +build !purego,!appengine,!js
 
 
 // This file contains the implementation of the proto field accesses using package unsafe.
 // This file contains the implementation of the proto field accesses using package unsafe.