Skip to content

Commit

Permalink
Cleanup code and add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
iverberk committed Jan 19, 2016
1 parent a1f6da7 commit 4330157
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
5 changes: 3 additions & 2 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -450,11 +450,12 @@ func (c *Client) setupNode() error {
node = &structs.Node{}
c.config.Node = node
}
id, err := c.nodeID()
// Generate an iD for the node
var err error
node.ID, err = c.nodeID()
if err != nil {
return fmt.Errorf("node ID setup failed: %v", err)
}
node.ID = id
if node.Attributes == nil {
node.Attributes = make(map[string]string)
}
Expand Down
5 changes: 4 additions & 1 deletion command/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,16 @@ type monitor struct {
ui cli.Ui
client *api.Client
state *evalState

// length determines the number of characters for identifiers in the ui.
length int

sync.Mutex
}

// newMonitor returns a new monitor. The returned monitor will
// write output information to the provided ui.
// write output information to the provided ui. The length parameter determines
// the number of characters for identifiers in the ui.
func newMonitor(ui cli.Ui, client *api.Client, length int) *monitor {
mon := &monitor{
ui: &cli.PrefixedUi{
Expand Down

0 comments on commit 4330157

Please sign in to comment.