mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2025-03-30 07:20:48 +00:00
encoding/textpb: use internal/fieldnum for well-known type fields
Change-Id: I40d73a6e75a42d3808c08606b307539a6aa07eb4 Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/170103 Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
This commit is contained in:
parent
82014a51c5
commit
e1e34939bf
@ -10,6 +10,7 @@ import (
|
||||
|
||||
"github.com/golang/protobuf/v2/internal/encoding/text"
|
||||
"github.com/golang/protobuf/v2/internal/errors"
|
||||
"github.com/golang/protobuf/v2/internal/fieldnum"
|
||||
"github.com/golang/protobuf/v2/internal/pragma"
|
||||
"github.com/golang/protobuf/v2/internal/set"
|
||||
"github.com/golang/protobuf/v2/proto"
|
||||
@ -497,8 +498,8 @@ func (o UnmarshalOptions) unmarshalAny(tfield [2]text.Value, knownFields pref.Kn
|
||||
return err
|
||||
}
|
||||
|
||||
knownFields.Set(pref.FieldNumber(1), pref.ValueOf(typeURL))
|
||||
knownFields.Set(pref.FieldNumber(2), pref.ValueOf(b))
|
||||
knownFields.Set(fieldnum.Any_TypeUrl, pref.ValueOf(typeURL))
|
||||
knownFields.Set(fieldnum.Any_Value, pref.ValueOf(b))
|
||||
|
||||
return nerr.E
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user