Browse Source

cleanup unreachable code

pull/498/head
Ali Abbas 10 years ago
parent
commit
e395420af6
  1. 1
      command/agent/dns.go
  2. 4
      command/agent/kvs_endpoint.go
  3. 1
      command/exec.go
  4. 4
      consul/fsm.go

1
command/agent/dns.go

@ -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.

4
command/agent/kvs_endpoint.go

@ -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

1
command/exec.go

@ -384,7 +384,6 @@ func (c *ExecCommand) streamResults(doneCh chan struct{}, ackCh chan rExecAck, h
} }
} }
} }
return
ERR_EXIT: ERR_EXIT:
select { select {

4
consul/fsm.go

@ -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…
Cancel
Save