diff --git a/agent/command/command.go b/agent/command/command.go index 92d670c8..5b1ab2fe 100644 --- a/agent/command/command.go +++ b/agent/command/command.go @@ -2,7 +2,7 @@ package command var ( - // Commmands keyed by golang/regexp patterns + // Commands keyed by golang/regexp patterns // regexp.Match(key, input) is used to match Commands = map[string]Command{} ) diff --git a/api/api.go b/api/api.go index 12a3d499..13465b63 100644 --- a/api/api.go +++ b/api/api.go @@ -18,7 +18,7 @@ type Api interface { Register(*Endpoint) error // Register a route Deregister(*Endpoint) error - // Implemenation of api + // Implementation of api String() string } diff --git a/api/handler/http/http.go b/api/handler/http/http.go index da429311..53b78c77 100644 --- a/api/handler/http/http.go +++ b/api/handler/http/http.go @@ -21,7 +21,7 @@ const ( type httpHandler struct { options handler.Options - // set with different initialiser + // set with different initializer s *api.Service } diff --git a/api/handler/options.go b/api/handler/options.go index 76f7eff5..f41c7303 100644 --- a/api/handler/options.go +++ b/api/handler/options.go @@ -62,7 +62,7 @@ func WithClient(c client.Client) Option { } } -// WithmaxRecvSize specifies max body size +// WithMaxRecvSize specifies max body size func WithMaxRecvSize(size int64) Option { return func(o *Options) { o.MaxRecvSize = size diff --git a/api/handler/rpc/rpc.go b/api/handler/rpc/rpc.go index fb326375..5243c250 100644 --- a/api/handler/rpc/rpc.go +++ b/api/handler/rpc/rpc.go @@ -265,7 +265,7 @@ func requestPayload(r *http.Request) ([]byte, error) { // otherwise as per usual ctx := r.Context() - // dont user meadata.FromContext as it mangles names + // dont user metadata.FromContext as it mangles names md, ok := metadata.FromContext(ctx) if !ok { md = make(map[string]string) diff --git a/broker/options.go b/broker/options.go index 18fd5935..674b3e2e 100644 --- a/broker/options.go +++ b/broker/options.go @@ -13,7 +13,7 @@ type Options struct { Secure bool Codec codec.Marshaler - // Handler executed when error happens in broker mesage + // Handler executed when error happens in broker message // processing ErrorHandler Handler diff --git a/client/client.go b/client/client.go index 039c4e48..7ab0a5e1 100644 --- a/client/client.go +++ b/client/client.go @@ -57,7 +57,7 @@ type Response interface { Read() ([]byte, error) } -// Stream is the inteface for a bidirectional synchronous stream +// Stream is the interface for a bidirectional synchronous stream type Stream interface { // Context for the stream Context() context.Context diff --git a/client/rpc_client.go b/client/rpc_client.go index c750ffd7..71c74cca 100644 --- a/client/rpc_client.go +++ b/client/rpc_client.go @@ -378,7 +378,7 @@ func (r *rpcClient) Call(ctx context.Context, request Request, response interfac return err } - // pass a node to enable backwards compatability as changing the + // pass a node to enable backwards comparability as changing the // call func would be a breaking change. // todo v3: change the call func to accept a route node := ®istry.Node{Address: route.Address, Metadata: route.Metadata} diff --git a/model/model.go b/model/model.go index ea5d7f28..9921b8df 100644 --- a/model/model.go +++ b/model/model.go @@ -32,7 +32,7 @@ type Entity interface { Name() string // The value associated with the entity Value() interface{} - // Attributes of the enity + // Attributes of the entity Attributes() map[string]interface{} // Read a value as a concrete type Read(v interface{}) error diff --git a/network/default.go b/network/default.go index b6870fd9..70ecb88b 100644 --- a/network/default.go +++ b/network/default.go @@ -634,7 +634,7 @@ func (n *network) processCtrlChan(listener tunnel.Listener) { // receive control message queue recv := make(chan *message, 128) - // accept ControlChannel cconnections + // accept ControlChannel connections go n.acceptCtrlConn(listener, recv) for { @@ -660,7 +660,7 @@ func (n *network) processCtrlChan(listener tunnel.Listener) { logger.Debugf("Network received advert message from: %s", pbRtrAdvert.Id) } - // loookup advertising node in our peer topology + // lookup advertising node in our peer topology advertNode := n.node.GetPeerNode(pbRtrAdvert.Id) if advertNode == nil { // if we can't find the node in our topology (MaxDepth) we skipp prcessing adverts @@ -913,7 +913,7 @@ func (n *network) processNetChan(listener tunnel.Listener) { logger.Debugf("Network failed refreshing peer %s: %v", pbNetPeer.Node.Id, err) } - // NOTE: we don't unpack MaxDepth toplogy + // NOTE: we don't unpack MaxDepth topology peer = UnpackPeerTopology(pbNetPeer, now, MaxDepth-1) // update the link peer.link = m.msg.Header["Micro-Link"] @@ -1217,7 +1217,7 @@ func (n *network) manage() { lastSent := links[peer.link] // check when we last sent to the peer - // and send a peer message if we havent + // and send a peer message if we haven't if lastSent.IsZero() || time.Since(lastSent) > KeepAliveTime { link := peer.link id := peer.id @@ -1351,7 +1351,7 @@ func (n *network) manage() { // pick a random peer from the list of peers and request full sync peer := n.node.GetPeerNode(peers[rnd.Intn(len(peers))].Id()) - // skip if we can't find randmly selected peer + // skip if we can't find randomly selected peer if peer == nil { continue } diff --git a/network/node.go b/network/node.go index b952f0ce..a6101994 100644 --- a/network/node.go +++ b/network/node.go @@ -167,7 +167,7 @@ func (n *node) walk(until func(peer *node) bool, action func(parent, peer *node) return visited } // iterate through all of the node peers - // mark the visited nodes; enqueue the non-visted + // mark the visited nodes; enqueue the non-visited for id, peer := range qnode.Value.(*node).peers { action(qnode.Value.(*node), peer) if _, ok := visited[id]; !ok { @@ -274,7 +274,7 @@ func (n *node) RefreshSync(now time.Time) error { // Nodes returns a slice of all nodes in the whole node topology func (n *node) Nodes() []Node { // we need to freeze the network graph here - // otherwise we might get inconsisten results + // otherwise we might get inconsistent results n.RLock() defer n.RUnlock() diff --git a/proxy/mucp/mucp.go b/proxy/mucp/mucp.go index 9cbe0604..4c774de4 100644 --- a/proxy/mucp/mucp.go +++ b/proxy/mucp/mucp.go @@ -122,7 +122,7 @@ func (p *Proxy) filterRoutes(ctx context.Context, routes []router.Route) []route // process only routes for this id if id, ok := md.Get("Micro-Router"); ok && len(id) > 0 { if route.Router != id { - // skip routes that don't mwatch + // skip routes that don't match continue } } @@ -130,7 +130,7 @@ func (p *Proxy) filterRoutes(ctx context.Context, routes []router.Route) []route // only process routes with this network if net, ok := md.Get("Micro-Namespace"); ok && len(net) > 0 { if route.Network != router.DefaultNetwork && route.Network != net { - // skip routes that don't mwatch + // skip routes that don't match continue } } diff --git a/registry/watcher.go b/registry/watcher.go index 33289e1b..c0dba682 100644 --- a/registry/watcher.go +++ b/registry/watcher.go @@ -23,9 +23,9 @@ type EventType int const ( // Create is emitted when a new service is registered Create EventType = iota - // Delete is emitted when an existing service is deregsitered + // Delete is emitted when an existing service is deregistered Delete - // Update is emitted when an existing servicec is updated + // Update is emitted when an existing service is updated Update ) diff --git a/service.go b/service.go index 256e1c0f..2e25fd8d 100644 --- a/service.go +++ b/service.go @@ -46,7 +46,7 @@ func newService(opts ...Option) Service { // pass the services auth namespace to the auth handler so it // uses this to verify requests, preventing the reliance on the - // unsecure Micro-Namespace header. + // insecure Micro-Namespace header. handlerNS := wrapper.AuthHandlerNamespace(options.Auth.Options().Issuer) // wrap the server to provide handler stats diff --git a/util/auth/auth.go b/util/auth/auth.go index 454a2d61..f46899d8 100644 --- a/util/auth/auth.go +++ b/util/auth/auth.go @@ -8,7 +8,7 @@ import ( "github.com/micro/go-micro/v2/logger" ) -// Verify the auth credentials and refresh the auth token periodicallay +// Verify the auth credentials and refresh the auth token periodically func Verify(a auth.Auth) error { // extract the account creds from options, these can be set by flags accID := a.Options().ID diff --git a/util/kubernetes/api/request.go b/util/kubernetes/api/request.go index 18c1ab24..938654c1 100644 --- a/util/kubernetes/api/request.go +++ b/util/kubernetes/api/request.go @@ -90,7 +90,7 @@ func (r *Request) Resource(s string) *Request { return r } -// SubResource sets a subresource on a resource, +// SubResource sets a sub resource on a resource, // e.g. pods/log for pod logs func (r *Request) SubResource(s string) *Request { r.subResource = &s @@ -132,7 +132,7 @@ func (r *Request) Body(in interface{}) *Request { return r } -// Params isused to set paramters on a request +// Params is used to set parameters on a request func (r *Request) Params(p *Params) *Request { for k, v := range p.LabelSelector { // create new key=value pair diff --git a/util/kubernetes/client/client.go b/util/kubernetes/client/client.go index b04de0ab..1109d7f3 100644 --- a/util/kubernetes/client/client.go +++ b/util/kubernetes/client/client.go @@ -37,7 +37,7 @@ type client struct { type Client interface { // Create creates new API resource Create(*Resource, ...CreateOption) error - // Get queries API resrouces + // Get queries API resources Get(*Resource, ...GetOption) error // Update patches existing API object Update(*Resource, ...UpdateOption) error diff --git a/util/pool/pool.go b/util/pool/pool.go index 68e43395..533879dd 100644 --- a/util/pool/pool.go +++ b/util/pool/pool.go @@ -13,7 +13,7 @@ type Pool interface { Close() error // Get a connection Get(addr string, opts ...transport.DialOption) (Conn, error) - // Releaes the connection + // Release the connection Release(c Conn, status error) error } diff --git a/util/signal/signal.go b/util/signal/signal.go index bb5b7492..aa1d1e18 100644 --- a/util/signal/signal.go +++ b/util/signal/signal.go @@ -5,7 +5,7 @@ import ( "syscall" ) -// ShutDownSingals returns all the singals that are being watched for to shut down services. +// ShutDownSignals returns all the signals that are being watched for to shut down services. func Shutdown() []os.Signal { return []os.Signal{ syscall.SIGTERM, syscall.SIGINT, syscall.SIGQUIT, syscall.SIGKILL, diff --git a/util/wrapper/wrapper_test.go b/util/wrapper/wrapper_test.go index 5b6ad09a..09d7fcb1 100644 --- a/util/wrapper/wrapper_test.go +++ b/util/wrapper/wrapper_test.go @@ -380,7 +380,7 @@ func TestCacheWrapper(t *testing.T) { return nil }, cli) - // perfroming two requests should increment the call count by two indicating the cache wasn't + // performing two requests should increment the call count by two indicating the cache wasn't // used even though the WithCache option was passed. w.Call(context.TODO(), req, nil, client.WithCache(time.Minute)) w.Call(context.TODO(), req, nil, client.WithCache(time.Minute)) @@ -398,7 +398,7 @@ func TestCacheWrapper(t *testing.T) { return cache }, cli) - // perfroming two requests should increment the call count by two since we didn't pass the WithCache + // performing two requests should increment the call count by two since we didn't pass the WithCache // option to Call. w.Call(context.TODO(), req, nil) w.Call(context.TODO(), req, nil) @@ -417,7 +417,7 @@ func TestCacheWrapper(t *testing.T) { return cache }, cli) - // perfroming two requests should increment the call count by once since the second request should + // performing two requests should increment the call count by once since the second request should // have used the cache. The correct value should be set on both responses and no errors should // be returned. rsp1 := &testRsp{}