Skip to content

Commit 5bd1d61

Browse files
committed
all: more typos
Change-Id: I7be32dd41cc3fdf2202d1dcb939790f2afba6505
1 parent e3f1ea1 commit 5bd1d61

File tree

10 files changed

+19
-19
lines changed

10 files changed

+19
-19
lines changed

compiler/protogen/protogen_opaque.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func opaqueNewMessageHook(message *Message) {
2121
// New name mangling scheme: Add a '_' between method base
2222
// name (Get, Set, Clear etc) and original field name if
2323
// needed. As a special case, there is one globally reserved
24-
// name, e.g. "Build" thet still results in actual renaming of
24+
// name, e.g. "Build" that still results in actual renaming of
2525
// the builder field like in the old scheme. We begin by
2626
// taking care of this special case.
2727
for _, field := range message.Fields {
@@ -45,7 +45,7 @@ func opaqueNewMessageHook(message *Message) {
4545
camelCases[field.camelCase] = true
4646

4747
}
48-
// For each field, check if any of it's methods would clash with an original field name
48+
// For each field, check if any of its methods would clash with an original field name
4949
for _, field := range message.Fields {
5050
// Every field (except the union fields, that are taken care of separately) has
5151
// a Get and a Set method.

internal/cmd/generate-types/proto.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ func (g GoType) NullableStar() Expr {
104104
return "*"
105105
}
106106

107-
// OpaqueNullablePointerMethod is the "internal/impl".pointer method used to access a opaque nullable pointer to this type.
107+
// OpaqueNullablePointerMethod is the "internal/impl".pointer method used to access an opaque nullable pointer to this type.
108108
func (g GoType) OpaqueNullablePointerMethod() Expr {
109109
switch g {
110110
case GoString:
@@ -117,7 +117,7 @@ func (g GoType) OpaqueNullablePointerMethod() Expr {
117117

118118
}
119119

120-
// OpaqueNullableStar is the prefix for dereferencing a opaque nullable value of this type.
120+
// OpaqueNullableStar is the prefix for dereferencing an opaque nullable value of this type.
121121
func (g GoType) OpaqueNullableStar() Expr {
122122
if g == GoString {
123123
return "*" // Strings have indirection even in opaque

internal/impl/api_export_opaque.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func (Export) UnmarshalField(msg any, fieldNum int32) {
2323
// &m.XXX_presence[1], num = 70)
2424
func (Export) Present(part *uint32, num uint32) bool {
2525
// This hook will read an unprotected shadow presence set if
26-
// we're unning under the race detector
26+
// we're running under the race detector
2727
raceDetectHookPresent(part, num)
2828
return atomic.LoadUint32(part)&(1<<(num%32)) > 0
2929
}

internal/impl/lazy_buffersharing_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ func testNoExcessiveCopy(t *testing.T, unmarshalOpts proto.UnmarshalOptions) {
140140
}
141141
b = (*m3.XXX_lazyUnmarshalInfo).Protobuf
142142
if m2len != 0 && len(b) == 0 {
143-
t.Errorf("The lazy backing store for submessage is empty when it is not for the surronding message: %v.", m2len)
143+
t.Errorf("The lazy backing store for submessage is empty when it is not for the surrounding message: %v.", m2len)
144144
}
145145
for i, x := range b {
146146
if x != byte(0xFF) {

internal/impl/presence.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func (p presence) ClearPresent(num uint32) {
5757
// LoadPresenceCache (together with PresentInCache) allows for a
5858
// cached version of checking for presence without re-reading the word
5959
// for every field. It is optimized for efficiency and assumes no
60-
// simltaneous mutation of the presence set (or at least does not have
60+
// simultaneous mutation of the presence set (or at least does not have
6161
// a problem with simultaneous mutation giving inconsistent results).
6262
func (p presence) LoadPresenceCache() (current uint32) {
6363
if p.P == nil {
@@ -123,7 +123,7 @@ func atomicStoreShadowPresence(p **[]byte, v *[]byte) {
123123

124124
// findPointerToRaceDetectData finds the preceding RaceDetectHookData
125125
// in a message by using pointer arithmetic. For the methods called
126-
// directy from generated code, we don't have a pointer to the
126+
// directly from generated code, we don't have a pointer to the
127127
// beginning of the presence set, but a pointer inside the array. As
128128
// we know the index of the bit we're manipulating (num), we can
129129
// calculate which element of the array ptr is pointing to. With that

internal/protolazy/bufferreader.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ func (b *BufferReader) SkipGroup(tag uint32) (err error) {
258258
return nil
259259
}
260260

261-
// skipVarint effiently skips a varint
261+
// skipVarint efficiently skips a varint
262262
func (b *BufferReader) SkipVarint() (err error) {
263263
i := b.Pos
264264

internal/protolazy/lazy.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,8 @@ func (lazy *XXX_lazyUnmarshalInfo) FindFieldInProto(fieldNum uint32) (start, end
323323
// a repeated field), and bools indicating if field was found and if there
324324
// are multiple encodings of the field in the byte range.
325325
//
326-
// To hande the uncommon case where there are repeated encodings for the same
327-
// field which are not consecutive in the protobuf (so we need to returns
326+
// To handle the uncommon case where there are repeated encodings for the same
327+
// field which are not consecutive in the protobuf (so we need to return
328328
// multiple start/end offsets), we also return a slice multipleEntries. If
329329
// multipleEntries is non-nil, then multiple entries were found, and the
330330
// values in the slice should be used, rather than start/end/found.

internal/race_test/lazy/lazy_race_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ func spawnCase(t *testing.T) {
184184
t.Fatalf("Failed to find my own executable: %v", err)
185185
}
186186
c := exec.Command(ep, "--test.run="+t.Name())
187-
// Set the environment variable so that we know we're in a subproceess when re-executed
187+
// Set the environment variable so that we know we're in a subprocess when re-executed
188188
c.Env = append(c.Env, envVar+"=true")
189189
out, err := c.CombinedOutput()
190190
// If we do not get an error, we fail in the parent process, otherwise we're good
@@ -310,9 +310,9 @@ func expandedLazy(m *testopaquepb.TestRequiredLazy) bool {
310310
return rf.Pointer() != 0
311311
}
312312

313-
// This test verifies all assumptions of TestParallellMarshalWithRequired
313+
// This test verifies all assumptions of TestParallelMarshalWithRequired
314314
// are (still) valid, to prevent the test from becoming a no-op (again).
315-
func TestParallellMarshalWithRequiredAssumptions(t *testing.T) {
315+
func TestParallelMarshalWithRequiredAssumptions(t *testing.T) {
316316
b, err := proto.Marshal(fillRequiredLazy())
317317
if err != nil {
318318
t.Fatal(err)
@@ -347,12 +347,12 @@ func TestParallellMarshalWithRequiredAssumptions(t *testing.T) {
347347
}
348348
}
349349

350-
// TestParallellMarshalWithRequired runs two goroutines that marshal the same
350+
// TestParallelMarshalWithRequired runs two goroutines that marshal the same
351351
// message. Marshaling a message can result in lazily decoding said message,
352352
// provided the message contains any required fields. This test ensures that
353353
// said lazy decoding can happen without causing races in the other goroutine
354354
// that marshals the same message.
355-
func TestParallellMarshalWithRequired(t *testing.T) {
355+
func TestParallelMarshalWithRequired(t *testing.T) {
356356
m := fillRequiredLazy()
357357
b, err := proto.MarshalOptions{}.Marshal(m)
358358
if err != nil {
@@ -432,7 +432,7 @@ func fillMixedOpaqueLazy() *mixedpb.OpaqueLazy {
432432
}.Build()
433433
}
434434

435-
func TestParallellMarshalMixed(t *testing.T) {
435+
func TestParallelMarshalMixed(t *testing.T) {
436436
m := fillMixedOpaqueLazy()
437437
b, err := proto.Marshal(m)
438438
if err != nil {

reflect/protorange/range.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ type Options struct {
7171
// Each field is preceded by a push of a [protopath.FieldAccess] step,
7272
// followed by recursive application of the rules on the field value,
7373
// and succeeded by a pop of that step.
74-
// If the message has unknown fields, then push an [protopath.UnknownAccess] step
74+
// If the message has unknown fields, then push a [protopath.UnknownAccess] step
7575
// followed immediately by pop of that step.
7676
//
7777
// - As an exception to the above rule, if the current message is a

reflect/protoreflect/type.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ type MessageDescriptor interface {
214214
ExtensionRanges() FieldRanges
215215
// ExtensionRangeOptions returns the ith extension range options.
216216
//
217-
// To avoid a dependency cycle, this method returns a proto.Message] value,
217+
// To avoid a dependency cycle, this method returns a proto.Message value,
218218
// which always contains a google.protobuf.ExtensionRangeOptions message.
219219
// This method returns a typed nil-pointer if no options are present.
220220
// The caller must import the descriptorpb package to use this.

0 commit comments

Comments
 (0)