mirror of https://github.com/status-im/consul.git
Merge pull request #498 from alouche/fix_sprintf_unreachable_code
Fix sprintf formatting and cleanup unreachable code
This commit is contained in:
commit
9c92ea5bcb
|
@ -310,7 +310,7 @@ func (c *Command) setupAgent(config *Config, logOutput io.Writer, logWriter *log
|
||||||
servers, err := NewHTTPServers(agent, config, logOutput)
|
servers, err := NewHTTPServers(agent, config, logOutput)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
agent.Shutdown()
|
agent.Shutdown()
|
||||||
c.Ui.Error(fmt.Sprintf("Error starting http servers:", err))
|
c.Ui.Error(fmt.Sprintf("Error starting http servers: %s", err))
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
c.httpServers = servers
|
c.httpServers = servers
|
||||||
|
|
|
@ -139,7 +139,6 @@ func NewDNSServer(agent *Agent, config *DNSConfig, logOutput io.Writer, domain s
|
||||||
case <-time.After(time.Second):
|
case <-time.After(time.Second):
|
||||||
return srv, fmt.Errorf("timeout setting up DNS server")
|
return srv, fmt.Errorf("timeout setting up DNS server")
|
||||||
}
|
}
|
||||||
return srv, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// recursorAddr is used to add a port to the recursor if omitted.
|
// recursorAddr is used to add a port to the recursor if omitted.
|
||||||
|
|
|
@ -3,11 +3,12 @@ package agent
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"fmt"
|
"fmt"
|
||||||
"github.com/hashicorp/consul/consul/structs"
|
|
||||||
"io"
|
"io"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
"github.com/hashicorp/consul/consul/structs"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -50,7 +51,6 @@ func (s *HTTPServer) KVSEndpoint(resp http.ResponseWriter, req *http.Request) (i
|
||||||
resp.WriteHeader(405)
|
resp.WriteHeader(405)
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
return nil, nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// KVSGet handles a GET request
|
// KVSGet handles a GET request
|
||||||
|
|
|
@ -384,7 +384,6 @@ func (c *ExecCommand) streamResults(doneCh chan struct{}, ackCh chan rExecAck, h
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return
|
|
||||||
|
|
||||||
ERR_EXIT:
|
ERR_EXIT:
|
||||||
select {
|
select {
|
||||||
|
|
|
@ -167,7 +167,6 @@ func (c *consulFSM) applyKVSOperation(buf []byte, index uint64) interface{} {
|
||||||
c.logger.Printf("[WARN] consul.fsm: Invalid KVS operation '%s'", req.Op)
|
c.logger.Printf("[WARN] consul.fsm: Invalid KVS operation '%s'", req.Op)
|
||||||
return fmt.Errorf("Invalid KVS operation '%s'", req.Op)
|
return fmt.Errorf("Invalid KVS operation '%s'", req.Op)
|
||||||
}
|
}
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *consulFSM) applySessionOperation(buf []byte, index uint64) interface{} {
|
func (c *consulFSM) applySessionOperation(buf []byte, index uint64) interface{} {
|
||||||
|
@ -188,7 +187,6 @@ func (c *consulFSM) applySessionOperation(buf []byte, index uint64) interface{}
|
||||||
c.logger.Printf("[WARN] consul.fsm: Invalid Session operation '%s'", req.Op)
|
c.logger.Printf("[WARN] consul.fsm: Invalid Session operation '%s'", req.Op)
|
||||||
return fmt.Errorf("Invalid Session operation '%s'", req.Op)
|
return fmt.Errorf("Invalid Session operation '%s'", req.Op)
|
||||||
}
|
}
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *consulFSM) applyACLOperation(buf []byte, index uint64) interface{} {
|
func (c *consulFSM) applyACLOperation(buf []byte, index uint64) interface{} {
|
||||||
|
@ -211,7 +209,6 @@ func (c *consulFSM) applyACLOperation(buf []byte, index uint64) interface{} {
|
||||||
c.logger.Printf("[WARN] consul.fsm: Invalid ACL operation '%s'", req.Op)
|
c.logger.Printf("[WARN] consul.fsm: Invalid ACL operation '%s'", req.Op)
|
||||||
return fmt.Errorf("Invalid ACL operation '%s'", req.Op)
|
return fmt.Errorf("Invalid ACL operation '%s'", req.Op)
|
||||||
}
|
}
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *consulFSM) Snapshot() (raft.FSMSnapshot, error) {
|
func (c *consulFSM) Snapshot() (raft.FSMSnapshot, error) {
|
||||||
|
@ -443,7 +440,6 @@ func (s *consulSnapshot) persistKV(sink raft.SnapshotSink,
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *consulSnapshot) Release() {
|
func (s *consulSnapshot) Release() {
|
||||||
|
|
Loading…
Reference in New Issue