encoding/textpb: reduce dependency on proto v1 package

Substitute protoV1.Marshal calls to use proto v2.

A few tests still need to use v1 due to missing required field checks in
v2.

Change-Id: I97ee208b81afc85c81142e70c1d7bdc47db76ce4
Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/167774
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
diff --git a/encoding/textpb/decode.go b/encoding/textpb/decode.go
index a621429..e545911 100644
--- a/encoding/textpb/decode.go
+++ b/encoding/textpb/decode.go
@@ -8,12 +8,10 @@
 	"fmt"
 	"strings"
 
-	protoV1 "github.com/golang/protobuf/proto"
 	"github.com/golang/protobuf/v2/internal/encoding/text"
 	"github.com/golang/protobuf/v2/internal/errors"
 	"github.com/golang/protobuf/v2/internal/pragma"
 	"github.com/golang/protobuf/v2/internal/set"
-	pvalue "github.com/golang/protobuf/v2/internal/value"
 	"github.com/golang/protobuf/v2/proto"
 	pref "github.com/golang/protobuf/v2/reflect/protoreflect"
 	"github.com/golang/protobuf/v2/reflect/protoregistry"
@@ -488,14 +486,7 @@
 		return err
 	}
 	// Serialize the embedded message and assign the resulting bytes to the value field.
-	// TODO: Switch to V2 marshal and enable deterministic option when ready.
-	var mv1 protoV1.Message
-	if mtmp, ok := m.(pvalue.Unwrapper); ok {
-		mv1 = mtmp.ProtoUnwrap().(protoV1.Message)
-	} else {
-		mv1 = m.Interface().(protoV1.Message)
-	}
-	b, err := protoV1.Marshal(mv1)
+	b, err := proto.Marshal(m.Interface())
 	if !nerr.Merge(err) {
 		return err
 	}