mirror of
https://github.com/protocolbuffers/protobuf-go.git
synced 2025-03-09 13:13:32 +00:00
all: fix golint violations
Change-Id: I35d9f6842ec2e9b36c14672a05c4381441bda87a Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/224582 Reviewed-by: Herbie Ong <herbie@google.com>
This commit is contained in:
parent
4e847add50
commit
8cbef3ff2d
@ -85,7 +85,7 @@ func (e *Encoder) WriteString(s string) error {
|
||||
}
|
||||
|
||||
// Sentinel error used for indicating invalid UTF-8.
|
||||
var invalidUTF8Err = errors.New("invalid UTF-8")
|
||||
var errInvalidUTF8 = errors.New("invalid UTF-8")
|
||||
|
||||
func appendString(out []byte, in string) ([]byte, error) {
|
||||
out = append(out, '"')
|
||||
@ -94,7 +94,7 @@ func appendString(out []byte, in string) ([]byte, error) {
|
||||
for len(in) > 0 {
|
||||
switch r, n := utf8.DecodeRuneInString(in); {
|
||||
case r == utf8.RuneError && n == 1:
|
||||
return out, invalidUTF8Err
|
||||
return out, errInvalidUTF8
|
||||
case r < ' ' || r == '"' || r == '\\':
|
||||
out = append(out, '\\')
|
||||
switch r {
|
||||
|
@ -16,7 +16,7 @@ package flags
|
||||
// As such, functionality may suddenly be removed or changed at our discretion.
|
||||
const ProtoLegacy = protoLegacy
|
||||
|
||||
// LazyUnmarshalExtension specifies whether to lazily unmarshal extensions.
|
||||
// LazyUnmarshalExtensions specifies whether to lazily unmarshal extensions.
|
||||
//
|
||||
// Lazy extension unmarshaling validates the contents of message-valued
|
||||
// extension fields at unmarshal time, but defers creating the message
|
||||
|
@ -170,7 +170,7 @@ func (m Message) Size() int {
|
||||
return n
|
||||
}
|
||||
|
||||
// Message encodes a syntax tree into the protobuf wire format.
|
||||
// Marshal encodes a syntax tree into the protobuf wire format.
|
||||
//
|
||||
// Example message definition:
|
||||
// message MyMessage {
|
||||
|
Loading…
x
Reference in New Issue
Block a user