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>
This commit is contained in:
Kir Kolyshkin 2022-05-17 17:29:33 -07:00 committed by Lasse Folger
parent 06eea5e15f
commit bf9455640d
11 changed files with 12 additions and 12 deletions

View File

@ -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(" }")

View File

@ -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:])

View File

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

View File

@ -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", "./...")

View File

@ -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")
}
}
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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