Skip to content
This repository has been archived by the owner on Sep 22, 2020. It is now read-only.

Fix function comments based on best practices from Effective Go #253

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 etcd/add_child.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package etcd

// Add a new directory with a random etcd-generated key under the given path.
// AddChildDir adds a new directory with a random etcd-generated key under the given path.
func (c *Client) AddChildDir(key string, ttl uint64) (*Response, error) {
raw, err := c.post(key, "", ttl)

Expand All @@ -11,7 +11,7 @@ func (c *Client) AddChildDir(key string, ttl uint64) (*Response, error) {
return raw.Unmarshal()
}

// Add a new file with a random etcd-generated key under the given path.
// AddChild adds a new file with a random etcd-generated key under the given path.
func (c *Client) AddChild(key string, value string, ttl uint64) (*Response, error) {
raw, err := c.post(key, value, ttl)

Expand Down
4 changes: 2 additions & 2 deletions etcd/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func NewClientFromReader(reader io.Reader) (*Client, error) {
return c, nil
}

// Override the Client's HTTP Transport object
// SetTransport: Override the Client's HTTP Transport object
func (c *Client) SetTransport(tr *http.Transport) {
c.httpClient.Transport = tr
c.transport = tr
Expand Down Expand Up @@ -252,7 +252,7 @@ func (c *Client) SetConsistency(consistency string) error {
return nil
}

// Sets the DialTimeout value
// SetDialTimeout: Sets the DialTimeout value
func (c *Client) SetDialTimeout(d time.Duration) {
c.config.DialTimeout = d
}
Expand Down
2 changes: 1 addition & 1 deletion etcd/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ type Node struct {

type Nodes []*Node

// interfaces for sorting
// Len: interfaces for sorting
func (ns Nodes) Len() int {
return len(ns)
}
Expand Down
2 changes: 1 addition & 1 deletion etcd/watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var (
ErrWatchStoppedByUser = errors.New("Watch stopped by the user via stop channel")
)

// If recursive is set to true the watch returns the first change under the given
// Watch: If recursive is set to true the watch returns the first change under the given
// prefix since the given index.
//
// If recursive is set to false the watch returns the first change to the given key
Expand Down