[fidl][go] Remove V2 flag guard for Go
A large number of GIDL tests are passing, so it seems like it is an
appropriate time to remove the flag guarding Go v2 decoding support.
Change-Id: I15f76675bec05c05b96f71f5bb223c317aa05bc5
Reviewed-on: https://fuchsia-review.googlesource.com/c/third_party/go/+/560022
Reviewed-by: Yifei Teng <yifeit@google.com>
Commit-Queue: Benjamin Prosnitz <bprosnitz@google.com>
diff --git a/api/fuchsia.txt b/api/fuchsia.txt
index 85c8941..b4f7d72 100644
--- a/api/fuchsia.txt
+++ b/api/fuchsia.txt
@@ -1087,7 +1087,6 @@
pkg syscall/zx/fidl, const Invalid ErrorCode
pkg syscall/zx/fidl, const ProtocolRights = 61454
pkg syscall/zx/fidl, const ProtocolRights zx.Rights
-pkg syscall/zx/fidl, func AllowV2WireFormatDecoding()
pkg syscall/zx/fidl, func CreateLazyMarshaler(interface{}) Marshaler
pkg syscall/zx/fidl, func CreateMarshaler(interface{}) (Marshaler, error)
pkg syscall/zx/fidl, func GetMarshalerContext(context.Context) (MarshalerContext, bool)
diff --git a/src/syscall/zx/fidl/ctx_and_header.go b/src/syscall/zx/fidl/ctx_and_header.go
index 78e9096..bac8a2f 100644
--- a/src/syscall/zx/fidl/ctx_and_header.go
+++ b/src/syscall/zx/fidl/ctx_and_header.go
@@ -4,13 +4,6 @@
package fidl
-var allowV2WireFormatDecoding bool
-
-// Enable V2 wire format decoding for this process.
-func AllowV2WireFormatDecoding() {
- allowV2WireFormatDecoding = true
-}
-
const FidlWireFormatMagicNumberInitial = 0x01
const FidlV2WireFormatFlagMask = 0x02
@@ -24,7 +17,7 @@
}
func (ctx MarshalerContext) isV2WireFormatDecodingEnabled() bool {
- return allowV2WireFormatDecoding && ctx.UseV2WireFormat
+ return ctx.UseV2WireFormat
}
// newCtx returns the default context.
diff --git a/src/syscall/zx/fidl/fidl_test/testutil_test.go b/src/syscall/zx/fidl/fidl_test/testutil_test.go
index e2f1edd..4a44f58 100644
--- a/src/syscall/zx/fidl/fidl_test/testutil_test.go
+++ b/src/syscall/zx/fidl/fidl_test/testutil_test.go
@@ -14,10 +14,6 @@
"syscall/zx/fidl"
)
-func init() {
- fidl.AllowV2WireFormatDecoding()
-}
-
func makeDefault(typ reflect.Type) fidl.Message {
if typ.Kind() != reflect.Ptr || typ.Elem().Kind() != reflect.Struct {
panic(fmt.Sprintf("expecting *struct, actual %s", typ))