Use reflection-driven field accesses under GopherJS. Like App Engine, GopherJS does not support unsafe. This change adds a 'js' build tag (set by GopherJS) alongside the existing 'appengine' tags. Fixes #154.
diff --git a/proto/pointer_reflect.go b/proto/pointer_reflect.go index 749919d..9899141 100644 --- a/proto/pointer_reflect.go +++ b/proto/pointer_reflect.go
@@ -29,7 +29,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// +build appengine +// +build appengine js // 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
diff --git a/proto/pointer_unsafe.go b/proto/pointer_unsafe.go index e9be0fe..ceece77 100644 --- a/proto/pointer_unsafe.go +++ b/proto/pointer_unsafe.go
@@ -29,7 +29,7 @@ // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// +build !appengine +// +build !appengine,!js // This file contains the implementation of the proto field accesses using package unsafe.