diff --git a/cache/cache_test.go b/cache/cache_test.go index 1d5dd4c3..b2ece4a7 100644 --- a/cache/cache_test.go +++ b/cache/cache_test.go @@ -101,7 +101,7 @@ func TestRemove(t *testing.T) { } d := noti.Delete[0] if len(d.Elem) != 1 { - t.Fatalf("got %d, want 1 elems in delete notificatin path", len(d.Elem)) + t.Fatalf("got %d, want 1 elems in delete notification path", len(d.Elem)) } if p := d.Elem[0].Name; p != "*" { t.Errorf("got %q, want %q in target delete path", p, "*") @@ -430,7 +430,7 @@ func TestGNMIQuery(t *testing.T) { }{ // This update is inserted here, but deleted below. {gnmiNotification("dev1", []string{}, []string{"a", "e"}, 0, "value1", false), true, ""}, - // This update is ovewritten below. + // This update is overwritten below. {gnmiNotification("dev1", []string{}, []string{"a", "b"}, 0, "value1", false), true, "value3"}, // This update is inserted and not modified. {gnmiNotification("dev1", []string{}, []string{"a", "c"}, 0, "value4", false), true, "value4"}, diff --git a/client/cache.go b/client/cache.go index cd2efbd5..cc18f63a 100644 --- a/client/cache.go +++ b/client/cache.go @@ -93,7 +93,7 @@ func (c *CacheClient) Poll() error { return c.BaseClient.Poll() } -// Synced will close when a sync is recieved from the query. +// Synced will close when a sync is received from the query. func (c *CacheClient) Synced() <-chan struct{} { return c.synced } diff --git a/client/client_test.go b/client/client_test.go index f4dd41aa..c6b36f4b 100644 --- a/client/client_test.go +++ b/client/client_test.go @@ -76,7 +76,7 @@ func TestRegister(t *testing.T) { clientType: []string{"bar"}, nErr: false, }, { - desc: "Unspecified client with prior registeration", + desc: "Unspecified client with prior registration", nErr: false, }, { desc: "Duplicate Registration", @@ -524,7 +524,7 @@ func ExampleClient_Poll() { for _, v := range c.Leaves() { fmt.Printf("%v: %v\n", v.Path, v.Val) } - err = c.Poll() // Poll allows the underyling Query to keep running + err = c.Poll() // Poll allows the underlying Query to keep running if err != nil { fmt.Println(err) return diff --git a/client/gnmi/client.go b/client/gnmi/client.go index 1cb0e220..91c4ee62 100644 --- a/client/gnmi/client.go +++ b/client/gnmi/client.go @@ -180,7 +180,7 @@ func (c *Client) Close() error { return c.conn.Close() } -// Recv will recieve a single message from the server and process it based on +// Recv will receive a single message from the server and process it based on // the provided handlers (Proto or Notification). func (c *Client) Recv() error { n, err := c.sub.Recv() diff --git a/client/gnmi/credentials.go b/client/gnmi/credentials.go index 4a0cf24f..ad9fd92f 100644 --- a/client/gnmi/credentials.go +++ b/client/gnmi/credentials.go @@ -31,7 +31,7 @@ type passCred struct { // GetRequestMetadata returns the current request metadata, including // username and password in this case. -// This implements the required interface fuction of credentials.Credentials. +// This implements the required interface function of credentials.Credentials. func (pc *passCred) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) { return map[string]string{ "username": pc.username, @@ -40,7 +40,7 @@ func (pc *passCred) GetRequestMetadata(ctx context.Context, uri ...string) (map[ } // RequireTransportSecurity indicates whether the credentials requires transport security. -// This implements the required interface fuction of credentials.Credentials. +// This implements the required interface function of credentials.Credentials. func (pc *passCred) RequireTransportSecurity() bool { return pc.secure } diff --git a/client/query.go b/client/query.go index c50f569d..359b3a32 100644 --- a/client/query.go +++ b/client/query.go @@ -147,7 +147,7 @@ type Query struct { // UpdatesOnly will only stream incremental updates rather than providing the // client with an initial snapshot. This again is implementation specific // if the agent doesn't not accept that query it is up the client library to - // decide wheter to return an error or to make a normal subscription then + // decide whether to return an error or to make a normal subscription then // ignore the initial sync and only provide increment updates. UpdatesOnly bool // Queries contains the list of Paths to query. @@ -161,7 +161,7 @@ type Query struct { // If Timeout is not set, default is 1 minute. Timeout time.Duration // NotificationHandler is the per notification callback handed to a vendor - // specific implementation. For every notificaiton this call back will be + // specific implementation. For every notification this call back will be // called. NotificationHandler NotificationHandler // ProtoHandler, if set, will receive all response protos sent by the @@ -221,7 +221,7 @@ func (c Credentials) validate() error { // NewQuery returns a populated Query from given gnmi SubscribeRequest. // Query fields that are not part of SubscribeRequest must be set on // the returned object. -// During transtion to support only gnmi, having Query and SubscribeRequest +// During transition to support only gnmi, having Query and SubscribeRequest // in sync is important. There are two approaches to ensure that; one is // validating whether Query and SubscribeRequest are same after they are set, the other is // populating the fields of Query from SubscribeRequest and filling out the rest diff --git a/cmd/gnmi_cli/gnmi_cli.go b/cmd/gnmi_cli/gnmi_cli.go index c06cdf08..2678c2f5 100644 --- a/cmd/gnmi_cli/gnmi_cli.go +++ b/cmd/gnmi_cli/gnmi_cli.go @@ -325,7 +325,7 @@ func parseQuery(query, delim string) ([]string, error) { if w == 0 || w != len(delim) { return nil, fmt.Errorf("delimiter must be single UTF-8 codepoint: %q", delim) } - // Ignore leading and trailing delimters. + // Ignore leading and trailing delimiters. query = strings.Trim(query, delim) // Split path on delimeter with contextually aware key/value handling. var buf []rune diff --git a/errdiff/errdiff.go b/errdiff/errdiff.go index b8709be1..30a5c586 100644 --- a/errdiff/errdiff.go +++ b/errdiff/errdiff.go @@ -43,7 +43,7 @@ limitations under the License. // // The generic function Check may be used in place of Code or // Substring or when comparing against another error or for simple -// existance of an error: +// existence of an error: // // testCases := []struct { // ... @@ -112,7 +112,7 @@ func Substring(got error, want string) string { // want. If want is a codes.Code, this function is the same as Code. // If want is a string, this function is the same as Substring. If // want is an error, this is essentially the same as ExactTextCompare(got, -// w.Error()). If want is a bool, err is simply tested for existance (want of +// w.Error()). If want is a bool, err is simply tested for existence (want of // true means an error is wanted). func Check(got error, want interface{}) string { switch w := want.(type) { diff --git a/errlist/errlist.go b/errlist/errlist.go index 9fda2a5a..d577f9cb 100644 --- a/errlist/errlist.go +++ b/errlist/errlist.go @@ -85,8 +85,8 @@ type List struct { // Errors is implemented by error types that can return lists of errors. type Errors interface { - // Errors returns the list of errors associated with the recevier. It - // returns nil if there are no errors associated with the recevier. + // Errors returns the list of errors associated with the receiver. It + // returns nil if there are no errors associated with the receiver. Errors() []error } @@ -96,7 +96,7 @@ var etype = reflect.TypeOf([]error{}) // Add adds all non-nil errs to the list of errors in e and returns true if errs // contains a non-nil error. If no non-nil errors are passed Add does nothing // and returns false. Add will never add a nil error to the List. If err -// implementes the Errors interface or its underlying type is a slice of errors +// implements the Errors interface or its underlying type is a slice of errors // then e.Add is called on each individual error. func (e *List) Add(errs ...error) bool { added := false diff --git a/manager/manager.go b/manager/manager.go index 23fb08a4..55b2704c 100644 --- a/manager/manager.go +++ b/manager/manager.go @@ -73,7 +73,7 @@ type Config struct { Update func(*gpb.Notification) // ConnectionManager is used to create gRPC connections. ConnectionManager ConnectionManager - // ConnectError record error from subcribe connections. + // ConnectError record error from subscribe connections. ConnectError func(string, error) } diff --git a/subscribe/subscribe.go b/subscribe/subscribe.go index e15e3819..b3e22a63 100644 --- a/subscribe/subscribe.go +++ b/subscribe/subscribe.go @@ -69,7 +69,7 @@ type ACL interface { Check(string, string) bool } -// Server is the implementation of the gNMI Subcribe API. +// Server is the implementation of the gNMI Subscribe API. type Server struct { pb.UnimplementedGNMIServer // Stub out all RPCs except Subscribe. diff --git a/testing/fake/gnmi/client.go b/testing/fake/gnmi/client.go index 99b304c1..85f30413 100644 --- a/testing/fake/gnmi/client.go +++ b/testing/fake/gnmi/client.go @@ -85,7 +85,7 @@ func (c *Client) Run(stream gpb.GNMI_SubscribeServer) (err error) { return grpc.Errorf(grpc.Code(err), "received error from client") } c.requests = append(c.requests, query) - log.V(1).Infof("Client %s recieved initial query: %v", c, query) + log.V(1).Infof("Client %s received initial query: %v", c, query) c.subscribe = query.GetSubscribe() if c.subscribe == nil { diff --git a/watch/watch.go b/watch/watch.go index 06edab46..4250aa66 100644 --- a/watch/watch.go +++ b/watch/watch.go @@ -25,7 +25,7 @@ import ( type Watcher interface { // Read blocks and returns the next update for a file. // - // An error is returned when there is an underyling issue in the Watcher + // An error is returned when there is an underlying issue in the Watcher // preventing Read, or ctx is cancelled. The returned error may indicate a // fatal issue requiring a new Watcher to be created. //