fix: typos (#2591)

This commit is contained in:
shaun
2019-01-24 01:59:48 +08:00
committed by Doug Fawley
parent 4cad6a6283
commit e9c1ac35ec
8 changed files with 14 additions and 14 deletions

View File

@ -17,7 +17,7 @@
*/ */
// See internal/backoff package for the backoff implementation. This file is // See internal/backoff package for the backoff implementation. This file is
// kept for the exported types and API backward compatility. // kept for the exported types and API backward compatibility.
package grpc package grpc

View File

@ -61,7 +61,7 @@ func init() {
} }
// Get returns the resolver builder registered with the given name. // Get returns the resolver builder registered with the given name.
// Note that the compare is done in a case-insenstive fashion. // Note that the compare is done in a case-insensitive fashion.
// If no builder is register with the name, nil will be returned. // If no builder is register with the name, nil will be returned.
func Get(name string) Builder { func Get(name string) Builder {
if b, ok := m[strings.ToLower(name)]; ok { if b, ok := m[strings.ToLower(name)]; ok {
@ -127,7 +127,7 @@ type ClientConn interface {
// The SubConn will be shutdown. // The SubConn will be shutdown.
RemoveSubConn(SubConn) RemoveSubConn(SubConn)
// UpdateBalancerState is called by balancer to nofity gRPC that some internal // UpdateBalancerState is called by balancer to notify gRPC that some internal
// state in balancer has changed. // state in balancer has changed.
// //
// gRPC will update the connectivity state of the ClientConn, and will call pick // gRPC will update the connectivity state of the ClientConn, and will call pick

View File

@ -40,7 +40,7 @@ func (cc *ClientConn) Invoke(ctx context.Context, method string, args, reply int
func combine(o1 []CallOption, o2 []CallOption) []CallOption { func combine(o1 []CallOption, o2 []CallOption) []CallOption {
// we don't use append because o1 could have extra capacity whose // we don't use append because o1 could have extra capacity whose
// elements would be overwritten, which could cause inadvertent // elements would be overwritten, which could cause inadvertent
// sharing (and race connditions) between concurrent calls // sharing (and race conditions) between concurrent calls
if len(o1) == 0 { if len(o1) == 0 {
return o2 return o2
} else if len(o2) == 0 { } else if len(o2) == 0 {

View File

@ -86,7 +86,7 @@ var (
// with other individual Transport Credentials. // with other individual Transport Credentials.
errTransportCredsAndBundle = errors.New("grpc: credentials.Bundle may not be used with individual TransportCredentials") errTransportCredsAndBundle = errors.New("grpc: credentials.Bundle may not be used with individual TransportCredentials")
// errTransportCredentialsMissing indicates that users want to transmit security // errTransportCredentialsMissing indicates that users want to transmit security
// information (e.g., oauth2 token) which requires secure connection on an insecure // information (e.g., OAuth2 token) which requires secure connection on an insecure
// connection. // connection.
errTransportCredentialsMissing = errors.New("grpc: the credentials require transport level security (use grpc.WithTransportCredentials() to set)") errTransportCredentialsMissing = errors.New("grpc: the credentials require transport level security (use grpc.WithTransportCredentials() to set)")
// errCredentialsConflict indicates that grpc.WithTransportCredentials() // errCredentialsConflict indicates that grpc.WithTransportCredentials()
@ -237,9 +237,9 @@ func DialContext(ctx context.Context, target string, opts ...DialOption) (conn *
grpclog.Infof("parsed scheme: %q", cc.parsedTarget.Scheme) grpclog.Infof("parsed scheme: %q", cc.parsedTarget.Scheme)
cc.dopts.resolverBuilder = resolver.Get(cc.parsedTarget.Scheme) cc.dopts.resolverBuilder = resolver.Get(cc.parsedTarget.Scheme)
if cc.dopts.resolverBuilder == nil { if cc.dopts.resolverBuilder == nil {
// If resolver builder is still nil, the parse target's scheme is // If resolver builder is still nil, the parsed target's scheme is
// not registered. Fallback to default resolver and set Endpoint to // not registered. Fallback to default resolver and set Endpoint to
// the original unparsed target. // the original target.
grpclog.Infof("scheme %q not registered, fallback to default scheme", cc.parsedTarget.Scheme) grpclog.Infof("scheme %q not registered, fallback to default scheme", cc.parsedTarget.Scheme)
cc.parsedTarget = resolver.Target{ cc.parsedTarget = resolver.Target{
Scheme: resolver.GetDefaultScheme(), Scheme: resolver.GetDefaultScheme(),
@ -436,7 +436,7 @@ func (cc *ClientConn) scWatcher() {
} }
cc.mu.Lock() cc.mu.Lock()
// TODO: load balance policy runtime change is ignored. // TODO: load balance policy runtime change is ignored.
// We may revist this decision in the future. // We may revisit this decision in the future.
cc.sc = sc cc.sc = sc
cc.scRaw = "" cc.scRaw = ""
cc.mu.Unlock() cc.mu.Unlock()

View File

@ -52,7 +52,7 @@ func (s State) String() string {
const ( const (
// Idle indicates the ClientConn is idle. // Idle indicates the ClientConn is idle.
Idle State = iota Idle State = iota
// Connecting indicates the ClienConn is connecting. // Connecting indicates the ClientConn is connecting.
Connecting Connecting
// Ready indicates the ClientConn is ready for work. // Ready indicates the ClientConn is ready for work.
Ready Ready

View File

@ -76,8 +76,8 @@ func formatIP(addr string) (addrIP string, ok bool) {
// parseTarget takes the user input target string, returns formatted host and port info. // parseTarget takes the user input target string, returns formatted host and port info.
// If target doesn't specify a port, set the port to be the defaultPort. // If target doesn't specify a port, set the port to be the defaultPort.
// If target is in IPv6 format and host-name is enclosed in sqarue brackets, brackets // If target is in IPv6 format and host-name is enclosed in square brackets, brackets
// are strippd when setting the host. // are stripped when setting the host.
// examples: // examples:
// target: "www.google.com" returns host: "www.google.com", port: "443" // target: "www.google.com" returns host: "www.google.com", port: "443"
// target: "ipv4-host:80" returns host: "ipv4-host", port: "80" // target: "ipv4-host:80" returns host: "ipv4-host", port: "80"

View File

@ -17,7 +17,7 @@
*/ */
// Package naming defines the naming API and related data structures for gRPC. // Package naming defines the naming API and related data structures for gRPC.
// The interface is EXPERIMENTAL and may be suject to change. // The interface is EXPERIMENTAL and may be subject to change.
// //
// Deprecated: please use package resolver. // Deprecated: please use package resolver.
package naming package naming

View File

@ -346,8 +346,8 @@ func formatIP(addr string) (addrIP string, ok bool) {
// parseTarget takes the user input target string and default port, returns formatted host and port info. // parseTarget takes the user input target string and default port, returns formatted host and port info.
// If target doesn't specify a port, set the port to be the defaultPort. // If target doesn't specify a port, set the port to be the defaultPort.
// If target is in IPv6 format and host-name is enclosed in sqarue brackets, brackets // If target is in IPv6 format and host-name is enclosed in square brackets, brackets
// are strippd when setting the host. // are stripped when setting the host.
// examples: // examples:
// target: "www.google.com" defaultPort: "443" returns host: "www.google.com", port: "443" // target: "www.google.com" defaultPort: "443" returns host: "www.google.com", port: "443"
// target: "ipv4-host:80" defaultPort: "443" returns host: "ipv4-host", port: "80" // target: "ipv4-host:80" defaultPort: "443" returns host: "ipv4-host", port: "80"