aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKir Kolyshkin <kolyshkin@gmail.com>2022-05-17 17:29:33 -0700
committerLasse Folger <lassefolger@google.com>2022-05-19 09:32:38 +0000
commitbf9455640daabb98c93b5b5e71628f3f813d57bb (patch)
tree23138f1529db5587c7e91a5adc0711b609ca5370
parent06eea5e15f43e0c4dc757179f79e08fde123bbe9 (diff)
downloadgolang-protobuf-bf9455640daabb98c93b5b5e71628f3f813d57bb.tar.gz
all: fix typos
Brought to you by codespell v2.1.0, using the command codespell -S .cache,vendor -L ot,ba,fo,unparseable -w Note that the misspelled "unparseable" comes from the github.com/protocolbuffers/protobuf, where it is explicitly ignored (see [1] and some explanation at [2]), so we ignore it here, too. [1] https://github.com/protocolbuffers/protobuf/pull/7752 [2] https://github.com/protocolbuffers/protobuf/pull/7751#discussion_r460170422 Change-Id: Ie1ca705db4f11df8ec8b22fdc22b6a6ee667ae5b Reviewed-on: https://go-review.googlesource.com/c/protobuf/+/406845 Reviewed-by: Damien Neil <dneil@google.com> Reviewed-by: Lasse Folger <lassefolger@google.com>
-rw-r--r--cmd/protoc-gen-go/internal_gengo/well_known_types.go2
-rw-r--r--compiler/protogen/protogen.go2
-rw-r--r--encoding/bench_test.go2
-rw-r--r--integration_test.go2
-rw-r--r--internal/encoding/json/bench_test.go2
-rw-r--r--internal/filedesc/build_test.go2
-rw-r--r--internal/order/range.go4
-rw-r--r--proto/bench_test.go2
-rw-r--r--testing/protocmp/xform.go2
-rw-r--r--testing/prototest/message.go2
-rw-r--r--types/known/fieldmaskpb/field_mask.pb.go2
11 files changed, 12 insertions, 12 deletions
diff --git a/cmd/protoc-gen-go/internal_gengo/well_known_types.go b/cmd/protoc-gen-go/internal_gengo/well_known_types.go
index dbaa529c..696dddb9 100644
--- a/cmd/protoc-gen-go/internal_gengo/well_known_types.go
+++ b/cmd/protoc-gen-go/internal_gengo/well_known_types.go
@@ -972,7 +972,7 @@ func genMessageKnownFunctions(g *protogen.GeneratedFile, f *fileInfo, m *message
g.P(" // Identify the next message to search within.")
g.P(" md = fd.Message() // may be nil")
g.P()
- g.P(" // Repeated fields are only allowed at the last postion.")
+ g.P(" // Repeated fields are only allowed at the last position.")
g.P(" if fd.IsList() || fd.IsMap() {")
g.P(" md = nil")
g.P(" }")
diff --git a/compiler/protogen/protogen.go b/compiler/protogen/protogen.go
index 2ee676fb..a475adfd 100644
--- a/compiler/protogen/protogen.go
+++ b/compiler/protogen/protogen.go
@@ -472,7 +472,7 @@ func newFile(gen *Plugin, p *descriptorpb.FileDescriptorProto, packageName GoPac
}
// splitImportPathAndPackageName splits off the optional Go package name
-// from the Go import path when seperated by a ';' delimiter.
+// from the Go import path when separated by a ';' delimiter.
func splitImportPathAndPackageName(s string) (GoImportPath, GoPackageName) {
if i := strings.Index(s, ";"); i >= 0 {
return GoImportPath(s[:i]), GoPackageName(s[i+1:])
diff --git a/encoding/bench_test.go b/encoding/bench_test.go
index 490656b3..ce95512e 100644
--- a/encoding/bench_test.go
+++ b/encoding/bench_test.go
@@ -16,7 +16,7 @@ import (
)
// The results of these microbenchmarks are unlikely to correspond well
-// to real world peformance. They are mainly useful as a quick check to
+// to real world performance. They are mainly useful as a quick check to
// detect unexpected regressions and for profiling specific cases.
const maxRecurseLevel = 3
diff --git a/integration_test.go b/integration_test.go
index f0d5e5e0..08a09126 100644
--- a/integration_test.go
+++ b/integration_test.go
@@ -124,7 +124,7 @@ func Test(t *testing.T) {
runGo("ProtocGenGo", command{Dir: "cmd/protoc-gen-go/testdata"}, "go", "test")
runGo("Conformance", command{Dir: "internal/conformance"}, "go", "test", "-execute")
- // Only run the 32-bit compatability tests for Linux;
+ // Only run the 32-bit compatibility tests for Linux;
// avoid Darwin since 10.15 dropped support i386 code execution.
if runtime.GOOS == "linux" {
runGo("Arch32Bit", command{Dir: workDir, Env: append(os.Environ(), "GOARCH=386")}, "go", "test", "./...")
diff --git a/internal/encoding/json/bench_test.go b/internal/encoding/json/bench_test.go
index bee85451..284b141a 100644
--- a/internal/encoding/json/bench_test.go
+++ b/internal/encoding/json/bench_test.go
@@ -19,7 +19,7 @@ func BenchmarkFloat(b *testing.B) {
b.Fatal(err)
}
if _, ok := val.Float(64); !ok {
- b.Fatal("not a flaot")
+ b.Fatal("not a float")
}
}
}
diff --git a/internal/filedesc/build_test.go b/internal/filedesc/build_test.go
index f8007a04..25a020ea 100644
--- a/internal/filedesc/build_test.go
+++ b/internal/filedesc/build_test.go
@@ -59,7 +59,7 @@ func TestInit(t *testing.T) {
// TODO: Test oneof and extension options. Testing these requires extending the
// options messages (because they contain no user-settable fields), but importing
- // decriptor.proto from test.proto currently causes an import cycle. Add test
+ // descriptor.proto from test.proto currently causes an import cycle. Add test
// cases when that import cycle has been fixed.
descPkg.Append("OneofDescriptorProto.options"): true,
}
diff --git a/internal/order/range.go b/internal/order/range.go
index c8090e0c..fe5ffcf9 100644
--- a/internal/order/range.go
+++ b/internal/order/range.go
@@ -25,7 +25,7 @@ type (
// FieldRnger is an interface for visiting all fields in a message.
// The protoreflect.Message type implements this interface.
FieldRanger interface{ Range(VisitField) }
- // VisitField is called everytime a message field is visited.
+ // VisitField is called every time a message field is visited.
VisitField = func(pref.FieldDescriptor, pref.Value) bool
)
@@ -76,7 +76,7 @@ type (
// EntryRanger is an interface for visiting all fields in a message.
// The protoreflect.Map type implements this interface.
EntryRanger interface{ Range(VisitEntry) }
- // VisitEntry is called everytime a map entry is visited.
+ // VisitEntry is called every time a map entry is visited.
VisitEntry = func(pref.MapKey, pref.Value) bool
)
diff --git a/proto/bench_test.go b/proto/bench_test.go
index 55bce593..9e9a9c1b 100644
--- a/proto/bench_test.go
+++ b/proto/bench_test.go
@@ -14,7 +14,7 @@ import (
)
// The results of these microbenchmarks are unlikely to correspond well
-// to real world peformance. They are mainly useful as a quick check to
+// to real world performance. They are mainly useful as a quick check to
// detect unexpected regressions and for profiling specific cases.
var (
diff --git a/testing/protocmp/xform.go b/testing/protocmp/xform.go
index 7a32e2d3..364a55ca 100644
--- a/testing/protocmp/xform.go
+++ b/testing/protocmp/xform.go
@@ -224,7 +224,7 @@ func Transform(...option) cmp.Option {
}
func isMessageType(t reflect.Type) bool {
- // Avoid tranforming the Message itself.
+ // Avoid transforming the Message itself.
if t == reflect.TypeOf(Message(nil)) || t == reflect.TypeOf((*Message)(nil)) {
return false
}
diff --git a/testing/prototest/message.go b/testing/prototest/message.go
index c104605f..9f111f7a 100644
--- a/testing/prototest/message.go
+++ b/testing/prototest/message.go
@@ -25,7 +25,7 @@ import (
// TODO: Test invalid field descriptors or oneof descriptors.
// TODO: This should test the functionality that can be provided by fast-paths.
-// Message tests a message implemention.
+// Message tests a message implementation.
type Message struct {
// Resolver is used to determine the list of extension fields to test with.
// If nil, this defaults to using protoregistry.GlobalTypes.
diff --git a/types/known/fieldmaskpb/field_mask.pb.go b/types/known/fieldmaskpb/field_mask.pb.go
index 7f94443d..1b2085d4 100644
--- a/types/known/fieldmaskpb/field_mask.pb.go
+++ b/types/known/fieldmaskpb/field_mask.pb.go
@@ -394,7 +394,7 @@ func numValidPaths(m proto.Message, paths []string) int {
// Identify the next message to search within.
md = fd.Message() // may be nil
- // Repeated fields are only allowed at the last postion.
+ // Repeated fields are only allowed at the last position.
if fd.IsList() || fd.IsMap() {
md = nil
}