style comments

This commit is contained in:
Barak Michener 2014-10-22 13:49:24 -04:00
parent 52dedab7b4
commit cb5a638c44
3 changed files with 6 additions and 8 deletions

View File

@ -41,6 +41,10 @@ type ServerConfig struct {
// VerifyBootstrapConfig sanity-checks the initial config and returns an error
// for things that should never happen.
func (c *ServerConfig) VerifyBootstrapConfig() error {
if c.NodeID == raft.None {
return fmt.Errorf("could not use %x as member id", raft.None)
}
if c.DiscoveryURL == "" && c.ClusterState != ClusterStateValueNew {
return fmt.Errorf("initial cluster state unset and no wal or discovery URL found")
}
@ -55,9 +59,6 @@ func (c *ServerConfig) VerifyBootstrapConfig() error {
if !isOk {
return fmt.Errorf("couldn't find local ID in cluster config")
}
if c.NodeID == raft.None {
return fmt.Errorf("could not use %x as member id", raft.None)
}
// No identical IPs in the cluster peer list
urlMap := make(map[string]bool)

View File

@ -61,10 +61,7 @@ func newMember(name string, peerURLs types.URLs, clusterName string, now *time.T
b = append(b, []byte(p)...)
}
if clusterName != "" {
b = append(b, []byte(clusterName)...)
}
b = append(b, []byte(clusterName)...)
if now != nil {
b = append(b, []byte(fmt.Sprintf("%d", now.Unix()))...)
}

View File

@ -291,7 +291,7 @@ func setupCluster() (*etcdserver.Member, error) {
return c, nil
}
}
return nil, fmt.Errorf("etcd: cannot find the passed name %s in --initial-cluster bootstrap list.", *name)
return nil, fmt.Errorf("cannot find the passed name %s in --initial-cluster bootstrap list.", *name)
}
return cluster.FindName(*name), nil
}