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:
Joe Tsai 2020-03-20 16:34:59 -07:00
parent 4e847add50
commit 8cbef3ff2d
3 changed files with 4 additions and 4 deletions

View File

@ -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 {

View File

@ -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

View File

@ -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 {