Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed some spelling in comments and logs #115

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cache/cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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, "*")
Expand Down Expand Up @@ -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"},
Expand Down
2 changes: 1 addition & 1 deletion client/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
4 changes: 2 additions & 2 deletions client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion client/gnmi/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions client/gnmi/credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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
}
Expand Down
6 changes: 3 additions & 3 deletions client/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cmd/gnmi_cli/gnmi_cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions errdiff/errdiff.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
// ...
Expand Down Expand Up @@ -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) {
Expand Down
6 changes: 3 additions & 3 deletions errlist/errlist.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion manager/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down
2 changes: 1 addition & 1 deletion subscribe/subscribe.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion testing/fake/gnmi/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion watch/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
//
Expand Down