Skip to content

Commit

Permalink
*: fix more typos (#7619)
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanBaulch committed Sep 16, 2024
1 parent 04e78b0 commit 3b626a7
Show file tree
Hide file tree
Showing 54 changed files with 103 additions and 103 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ We definitely welcome your patches and contributions to gRPC! Please read the gR
organization's [governance rules](https://github.com/grpc/grpc-community/blob/master/governance.md)
and [contribution guidelines](https://github.com/grpc/grpc-community/blob/master/CONTRIBUTING.md) before proceeding.

If you are new to github, please start by reading [Pull Request howto](https://help.github.com/articles/about-pull-requests/)
If you are new to GitHub, please start by reading [Pull Request howto](https://help.github.com/articles/about-pull-requests/)

## Legal requirements

Expand Down Expand Up @@ -39,7 +39,7 @@ How to get your contributions merged smoothly and quickly.
proposal](https://github.com/grpc/proposal).

- Provide a good **PR description** as a record of **what** change is being made
and **why** it was made. Link to a github issue if it exists.
and **why** it was made. Link to a GitHub issue if it exists.

- If you want to fix formatting or style, consider whether your changes are an
obvious improvement or might be considered a personal preference. If a style
Expand Down
2 changes: 1 addition & 1 deletion Documentation/encoding.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ performing compression and decompression.
A `Compressor` contains code to compress and decompress by wrapping `io.Writer`s
and `io.Reader`s, respectively. (The form of `Compress` and `Decompress` were
chosen to most closely match Go's standard package
[implementations](https://golang.org/pkg/compress/) of compressors. Like
[implementations](https://golang.org/pkg/compress/) of compressors). Like
`Codec`s, `Compressor`s are registered by name into a global registry maintained
in the `encoding` package.

Expand Down
2 changes: 1 addition & 1 deletion Documentation/grpc-auth-support.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Authentication

As outlined in the [gRPC authentication guide](https://grpc.io/docs/guides/auth.html) there are a number of different mechanisms for asserting identity between an client and server. We'll present some code-samples here demonstrating how to provide TLS support encryption and identity assertions as well as passing OAuth2 tokens to services that support it.
As outlined in the [gRPC authentication guide](https://grpc.io/docs/guides/auth.html) there are a number of different mechanisms for asserting identity between a client and server. We'll present some code-samples here demonstrating how to provide TLS support encryption and identity assertions as well as passing OAuth2 tokens to services that support it.

# Enabling TLS on a gRPC client

Expand Down
2 changes: 1 addition & 1 deletion balancer/balancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ type SubConn interface {
// UpdateAddresses updates the addresses used in this SubConn.
// gRPC checks if currently-connected address is still in the new list.
// If it's in the list, the connection will be kept.
// If it's not in the list, the connection will gracefully closed, and
// If it's not in the list, the connection will gracefully close, and
// a new connection will be created.
//
// This will trigger a state transition for the SubConn.
Expand Down
2 changes: 1 addition & 1 deletion balancer/base/balancer.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func (b *baseBalancer) UpdateClientConnState(s balancer.ClientConnState) error {
}
}
// If resolver state contains no addresses, return an error so ClientConn
// will trigger re-resolve. Also records this as an resolver error, so when
// will trigger re-resolve. Also records this as a resolver error, so when
// the overall state turns transient failure, the error message will have
// the zero address information.
if len(s.ResolverState.Addresses) == 0 {
Expand Down
2 changes: 1 addition & 1 deletion balancer/endpointsharding/endpointsharding.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ func (es *endpointSharding) UpdateClientConnState(state balancer.ClientConnState
// Return first error found, and always commit full processing of
// updating children. If desired to process more specific errors
// across all endpoints, caller should make these specific
// validations, this is a current limitation for simplicities sake.
// validations, this is a current limitation for simplicity sake.
ret = err
}
}
Expand Down
2 changes: 1 addition & 1 deletion balancer/grpclb/grpclb.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ type lbBalancer struct {

// manualResolver is used in the remote LB ClientConn inside grpclb. When
// resolved address updates are received by grpclb, filtered updates will be
// send to remote LB ClientConn through this resolver.
// sent to remote LB ClientConn through this resolver.
manualResolver *manual.Resolver
// The ClientConn to talk to the remote balancer.
ccRemoteLB *remoteBalancerCCWrapper
Expand Down
2 changes: 1 addition & 1 deletion balancer/rls/internal/keys/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func (b builder) Equal(a builder) bool {
// Protobuf serialization maintains the order of repeated fields. Matchers
// are specified as a repeated field inside the KeyBuilder proto. If the
// order changes, it means that the order in the protobuf changed. We report
// this case as not being equal even though the builders could possible be
// this case as not being equal even though the builders could possibly be
// functionally equal.
for i, bMatcher := range b.headerKeys {
aMatcher := a.headerKeys[i]
Expand Down
2 changes: 1 addition & 1 deletion balancer/weightedroundrobin/balancer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func (s) TestBalancer_OneAddress(t *testing.T) {
// balancer startup case which triggers the first picker and scheduler update
// before any load reports are received.
//
// Note that this test and others, metrics emission asssertions are a snapshot
// Note that this test and others, metrics emission assertions are a snapshot
// of the most recently emitted metrics. This is due to the nondeterminism of
// scheduler updates with respect to test bodies, so the assertions made are
// from the most recently synced state of the system (picker/scheduler) from the
Expand Down
2 changes: 1 addition & 1 deletion benchmark/benchmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ func StartServer(info ServerInfo, opts ...grpc.ServerOption) func() {
}
}

// DoUnaryCall performs an unary RPC with given stub and request and response sizes.
// DoUnaryCall performs a unary RPC with given stub and request and response sizes.
func DoUnaryCall(tc testgrpc.BenchmarkServiceClient, reqSize, respSize int) error {
pl := NewPayload(testpb.PayloadType_COMPRESSABLE, reqSize)
req := &testpb.SimpleRequest{
Expand Down
2 changes: 1 addition & 1 deletion benchmark/benchresult/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ To format the benchmark result:
go run benchmark/benchresult/main.go resultfile
To see the performance change based on a old result:
To see the performance change based on an old result:
go run benchmark/benchresult/main.go resultfile_old resultfile
Expand Down
2 changes: 1 addition & 1 deletion clientconn.go
Original file line number Diff line number Diff line change
Expand Up @@ -1292,7 +1292,7 @@ func (ac *addrConn) resetTransportAndUnlock() {
ac.mu.Unlock()
}

// tryAllAddrs tries to creates a connection to the addresses, and stop when at
// tryAllAddrs tries to create a connection to the addresses, and stop when at
// the first successful one. It returns an error if no address was successfully
// connected, or updates ac appropriately with the new transport.
func (ac *addrConn) tryAllAddrs(ctx context.Context, addrs []resolver.Address, connectDeadline time.Time) error {
Expand Down
2 changes: 1 addition & 1 deletion clientconn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ func (s) TestCloseConnectionWhenServerPrefaceNotReceived(t *testing.T) {
case <-timer.C:
t.Fatalf("Client didn't make another connection request in time.")
}
// Make sure the connection stays alive for sometime.
// Make sure the connection stays alive for some time.
time.Sleep(time.Second)
atomic.StoreUint32(&over, 1)
client.Close()
Expand Down
2 changes: 1 addition & 1 deletion credentials/xds/xds_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func (ts *testServer) start() error {
return nil
}

// handleconn accepts a new raw connection, and invokes the test provided
// handleConn accepts a new raw connection, and invokes the test provided
// handshake function to perform TLS handshake, and returns the result on the
// `hsResult` channel.
func (ts *testServer) handleConn() {
Expand Down
2 changes: 1 addition & 1 deletion dialoptions.go
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ func WithTimeout(d time.Duration) DialOption {
// option to true from the Control field. For a concrete example of how to do
// this, see internal.NetDialerWithTCPKeepalive().
//
// For more information, please see [issue 23459] in the Go github repo.
// For more information, please see [issue 23459] in the Go GitHub repo.
//
// [issue 23459]: https://github.com/golang/go/issues/23459
func WithContextDialer(f func(context.Context, string) (net.Conn, error)) DialOption {
Expand Down
10 changes: 5 additions & 5 deletions encoding/encoding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ func (c *errProtoCodec) Name() string {
func (s) TestEncodeDoesntPanicOnServer(t *testing.T) {
grpctest.TLogger.ExpectError("grpc: server failed to encode response")

// Create an codec that errors when encoding messages.
// Create a codec that errors when encoding messages.
encodingErr := errors.New("encoding failed")
ec := &errProtoCodec{name: t.Name(), encodingErr: encodingErr}

Expand Down Expand Up @@ -150,7 +150,7 @@ func (s) TestEncodeDoesntPanicOnServer(t *testing.T) {
// Tests the case where decoding fails on the server. Verifies that there is
// no panic and that the decoding error is propagated to the client.
func (s) TestDecodeDoesntPanicOnServer(t *testing.T) {
// Create an codec that errors when decoding messages.
// Create a codec that errors when decoding messages.
decodingErr := errors.New("decoding failed")
ec := &errProtoCodec{name: t.Name(), decodingErr: decodingErr}

Expand Down Expand Up @@ -192,7 +192,7 @@ func (s) TestEncodeDoesntPanicOnClient(t *testing.T) {
backend := stubserver.StartTestService(t, nil)
defer backend.Stop()

// Create an codec that errors when encoding messages.
// Create a codec that errors when encoding messages.
encodingErr := errors.New("encoding failed")
ec := &errProtoCodec{name: t.Name(), encodingErr: encodingErr}

Expand Down Expand Up @@ -228,7 +228,7 @@ func (s) TestDecodeDoesntPanicOnClient(t *testing.T) {
backend := stubserver.StartTestService(t, nil)
defer backend.Stop()

// Create an codec that errors when decoding messages.
// Create a codec that errors when decoding messages.
decodingErr := errors.New("decoding failed")
ec := &errProtoCodec{name: t.Name(), decodingErr: decodingErr}

Expand Down Expand Up @@ -283,7 +283,7 @@ func (p *countingProtoCodec) Name() string {
// Tests the case where ForceServerCodec option is used on the server. Verifies
// that encoding and decoding happen once per RPC.
func (s) TestForceServerCodec(t *testing.T) {
// Create an server with the counting proto codec.
// Create a server with the counting proto codec.
codec := &countingProtoCodec{name: t.Name()}
backend := stubserver.StartTestService(t, nil, grpc.ForceServerCodecV2(codec))
defer backend.Stop()
Expand Down
8 changes: 4 additions & 4 deletions examples/features/advancedtls/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,15 @@ func makeCRLProvider(crlDirectory string) *advancedtls.FileWatcherCRLProvider {
}

// --- Custom Verification ---
func customVerificaitonSucceed(info *advancedtls.HandshakeVerificationInfo) (*advancedtls.PostHandshakeVerificationResults, error) {
func customVerificationSucceed(info *advancedtls.HandshakeVerificationInfo) (*advancedtls.PostHandshakeVerificationResults, error) {
// Looks at info for what you care about as the custom verification implementer
if info.ServerName != "localhost:50051" {
return nil, fmt.Errorf("expected servername of localhost:50051, got %v", info.ServerName)
}
return &advancedtls.PostHandshakeVerificationResults{}, nil
}

func customVerificaitonFail(info *advancedtls.HandshakeVerificationInfo) (*advancedtls.PostHandshakeVerificationResults, error) {
func customVerificationFail(info *advancedtls.HandshakeVerificationInfo) (*advancedtls.PostHandshakeVerificationResults, error) {
// Looks at info for what you care about as the custom verification implementer
if info.ServerName != "ExampleDesignedToFail" {
return nil, fmt.Errorf("expected servername of ExampleDesignedToFail, got %v", info.ServerName)
Expand Down Expand Up @@ -191,7 +191,7 @@ func runClientWithCustomVerification(credsDirectory string, port string) {
},
// Tell the client to verify the server cert
VerificationType: advancedtls.CertVerification,
AdditionalPeerVerification: customVerificaitonSucceed,
AdditionalPeerVerification: customVerificationSucceed,
}

clientTLSCreds, err := advancedtls.NewClientCreds(options)
Expand All @@ -215,7 +215,7 @@ func runClientWithCustomVerification(credsDirectory string, port string) {
},
// Tell the client to verify the server cert
VerificationType: advancedtls.CertVerification,
AdditionalPeerVerification: customVerificaitonFail,
AdditionalPeerVerification: customVerificationFail,
}

clientTLSCreds, err := advancedtls.NewClientCreds(options)
Expand Down
2 changes: 1 addition & 1 deletion examples/features/advancedtls/creds/openssl-ca.cnf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
base_dir = .
certificate = $base_dir/ca_cert.pem # The CA certifcate
certificate = $base_dir/ca_cert.pem # The CA certificate
private_key = $base_dir/ca_key.pem # The CA private key
new_certs_dir = $base_dir # Location for new certs after signing
database = $base_dir/index.txt # Database index file
Expand Down
2 changes: 1 addition & 1 deletion examples/features/advancedtls/openssl-ca.cnf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
base_dir = .
certificate = $base_dir/ca_cert.pem # The CA certifcate
certificate = $base_dir/ca_cert.pem # The CA certificate
private_key = $base_dir/ca_key.pem # The CA private key
new_certs_dir = $base_dir # Location for new certs after signing
database = $base_dir/index.txt # Database index file
Expand Down
2 changes: 1 addition & 1 deletion examples/features/csm_observability/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func main() {
defer cc.Close()
c := echo.NewEchoClient(cc)

// Make a RPC every second. This should trigger telemetry to be emitted from
// Make an RPC every second. This should trigger telemetry to be emitted from
// the client and the server.
for {
ctx, cancel := context.WithTimeout(context.Background(), time.Second*5)
Expand Down
2 changes: 1 addition & 1 deletion examples/features/encryption/ALTS/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ func main() {
}
defer conn.Close()

// Make a echo client and send an RPC.
// Make an echo client and send an RPC.
rgc := ecpb.NewEchoClient(conn)
callUnaryEcho(rgc, "hello world")
}
2 changes: 1 addition & 1 deletion examples/features/encryption/TLS/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func main() {
}
defer conn.Close()

// Make a echo client and send an RPC.
// Make an echo client and send an RPC.
rgc := ecpb.NewEchoClient(conn)
callUnaryEcho(rgc, "hello world")
}
2 changes: 1 addition & 1 deletion examples/features/interceptor/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ func main() {
}
defer conn.Close()

// Make a echo client and send RPCs.
// Make an echo client and send RPCs.
rgc := ecpb.NewEchoClient(conn)
callUnaryEcho(rgc, "hello world")
callBidiStreamingEcho(rgc)
Expand Down
2 changes: 1 addition & 1 deletion examples/features/opentelemetry/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func main() {
defer cc.Close()
c := echo.NewEchoClient(cc)

// Make a RPC every second. This should trigger telemetry to be emitted from
// Make an RPC every second. This should trigger telemetry to be emitted from
// the client and the server.
for {
r, err := c.UnaryEcho(ctx, &echo.EchoRequest{Message: "this is examples/opentelemetry"})
Expand Down
2 changes: 1 addition & 1 deletion examples/gotutorial.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This tutorial provides a basic Go programmer's introduction to working with gRPC
- Generate server and client code using the protocol buffer compiler.
- Use the Go gRPC API to write a simple client and server for your service.

It assumes that you have read the [Getting started](https://github.com/grpc/grpc/tree/master/examples) guide and are familiar with [protocol buffers](https://developers.google.com/protocol-buffers/docs/overview). Note that the example in this tutorial uses the proto3 version of the protocol buffers language, you can find out more in the [proto3 language guide](https://developers.google.com/protocol-buffers/docs/proto3) and see the [release notes](https://github.com/google/protobuf/releases) for the new version in the protocol buffers Github repository.
It assumes that you have read the [Getting started](https://github.com/grpc/grpc/tree/master/examples) guide and are familiar with [protocol buffers](https://developers.google.com/protocol-buffers/docs/overview). Note that the example in this tutorial uses the proto3 version of the protocol buffers language, you can find out more in the [proto3 language guide](https://developers.google.com/protocol-buffers/docs/proto3) and see the [release notes](https://github.com/google/protobuf/releases) for the new version in the protocol buffers GitHub repository.

This isn't a comprehensive guide to using gRPC in Go: more reference documentation is coming soon.

Expand Down
4 changes: 2 additions & 2 deletions gcp/observability/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,8 +245,8 @@ type cloudLogging struct {
type cloudMonitoring struct{}

type cloudTrace struct {
// SamplingRate is the global setting that controls the probability of a RPC
// being traced. For example, 0.05 means there is a 5% chance for a RPC to
// SamplingRate is the global setting that controls the probability of an RPC
// being traced. For example, 0.05 means there is a 5% chance for an RPC to
// be traced, 1.0 means trace every call, 0 means don’t start new traces. By
// default, the sampling_rate is 0.
SamplingRate float64 `json:"sampling_rate,omitempty"`
Expand Down
4 changes: 2 additions & 2 deletions internal/balancer/gracefulswitch/gracefulswitch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func (s) TestSuccessfulFirstUpdate(t *testing.T) {
// TestTwoBalancersSameType tests the scenario where there is a graceful switch
// load balancer setup with a current and pending load balancer of the same
// type. Any ClientConn update should be forwarded to the current lb if there is
// a current lb and no pending lb, and the only the pending lb if the graceful
// a current lb and no pending lb, and only the pending lb if the graceful
// switch balancer contains both a current lb and a pending lb. The pending load
// balancer should also swap into current whenever it updates with a
// connectivity state other than CONNECTING.
Expand Down Expand Up @@ -725,7 +725,7 @@ func (s) TestUpdateSubConnStateRace(t *testing.T) {
}

// TestInlineCallbackInBuild tests the scenario where a balancer calls back into
// the balancer.ClientConn API inline from it's build function.
// the balancer.ClientConn API inline from its build function.
func (s) TestInlineCallbackInBuild(t *testing.T) {
tcc, gsb := setup(t)
// This build call should cause all of the inline updates to forward to the
Expand Down
2 changes: 1 addition & 1 deletion internal/balancergroup/balancergroup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ func (s) TestBalancerGroup_start_close(t *testing.T) {
// The callback will try to hold the same lock again, which will cause a
// deadlock.
//
// This test starts the balancer group with a test balancer, will updates picker
// This test starts the balancer group with a test balancer, will update picker
// whenever it gets an address update. It's expected that start() doesn't block
// because of deadlock.
func (s) TestBalancerGroup_start_close_deadlock(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/grpcsync/callback_serializer.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func NewCallbackSerializer(ctx context.Context) *CallbackSerializer {
return cs
}

// TrySchedule tries to schedules the provided callback function f to be
// TrySchedule tries to schedule the provided callback function f to be
// executed in the order it was added. This is a best-effort operation. If the
// context passed to NewCallbackSerializer was canceled before this method is
// called, the callback will not be scheduled.
Expand Down
2 changes: 1 addition & 1 deletion internal/grpcutil/method.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func ParseMethod(methodName string) (service, method string, _ error) {
}

// baseContentType is the base content-type for gRPC. This is a valid
// content-type on it's own, but can also include a content-subtype such as
// content-type on its own, but can also include a content-subtype such as
// "proto" as a suffix after "+" or ";". See
// https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md#requests
// for more details.
Expand Down
2 changes: 1 addition & 1 deletion internal/idle/idle.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ func (m *Manager) ExitIdleMode() error {
// came in and OnCallBegin() noticed that the calls count is negative.
// - Channel is in idle mode, and multiple new RPCs come in at the same
// time, all of them notice a negative calls count in OnCallBegin and get
// here. The first one to get the lock would got the channel to exit idle.
// here. The first one to get the lock would get the channel to exit idle.
// - Channel is not in idle mode, and the user calls Connect which calls
// m.ExitIdleMode.
//
Expand Down
4 changes: 2 additions & 2 deletions internal/idle/idle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func (s) TestManager_Enabled_TimerFires(t *testing.T) {
defer mgr.Close()
mgr.ExitIdleMode()

// Ensure that the timer callback fires within a appropriate amount of time.
// Ensure that the timer callback fires within an appropriate amount of time.
select {
case <-callbackCh:
case <-time.After(2 * defaultTestIdleTimeout):
Expand Down Expand Up @@ -306,7 +306,7 @@ const (
stateActiveRPCs
)

// racyIdlnessEnforcer is a test idleness enforcer used specifically to test the
// racyEnforcer is a test idleness enforcer used specifically to test the
// race between idle timeout and incoming RPCs.
type racyEnforcer struct {
t *testing.T
Expand Down
2 changes: 1 addition & 1 deletion internal/internal.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ var (
//
// The implementation is expected to create a health checking RPC stream by
// calling newStream(), watch for the health status of serviceName, and report
// it's health back by calling setConnectivityState().
// its health back by calling setConnectivityState().
//
// The health checking protocol is defined at:
// https://github.com/grpc/grpc/blob/master/doc/health-checking.md
Expand Down
Loading

0 comments on commit 3b626a7

Please sign in to comment.