Cleanup code and add comments
This commit is contained in:
parent
c1829e7f1f
commit
9c46eceeac
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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{
|
||||
|
|
Loading…
Reference in New Issue