1
0
Fork 0

'go vet' fixes

master
Philip O'Toole 10 years ago
parent 783eece7e7
commit 2def761ec9

@ -61,7 +61,7 @@ func (c *TransactionExecuteCommandSet) Apply(server raft.Server) (interface{}, e
if !commitSuccess {
err := db.RollbackTransaction()
if err != nil {
log.Error("Failed to rollback transaction: %s", err.Error)
log.Logf(log.ERROR, "Failed to rollback transaction: %s", err.Error())
}
}
}()

@ -98,7 +98,7 @@ func main() {
log.Info("Profiling enabled")
f, err := os.Create(cpuprofile)
if err != nil {
log.Error("Unable to create path: %s", err.Error())
log.Logf(log.ERROR, "Unable to create path: %s", err.Error())
}
defer f.Close()
@ -116,7 +116,7 @@ func main() {
}
path := flag.Arg(0)
if err := os.MkdirAll(path, 0744); err != nil {
log.Error("Unable to create path: %s", err.Error())
log.Logf(log.ERROR, "Unable to create path: %s", err.Error())
}
s := server.NewServer(path, dbfile, snapAfter, host, port)

@ -221,7 +221,7 @@ func (s *Server) connectionString() string {
// logSnapshot logs about the snapshot that was taken.
func (s *Server) logSnapshot(err error, currentIndex, count uint64) {
info := fmt.Sprintf("%s: snapshot of %d events at index %d", s.connectionString, count, currentIndex)
info := fmt.Sprintf("%s: snapshot of %d events at index %d", s.connectionString(), count, currentIndex)
if err != nil {
log.Info("%s attempted and failed: %v", info, err)
} else {
@ -247,7 +247,7 @@ func (s *Server) ListenAndServe(leader string) error {
log.Info("Loading latest snapshot, if any, from disk")
err = s.raftServer.LoadSnapshot()
if err != nil {
log.Error("Error loading snapshot: %s", err.Error())
log.Logf(log.ERROR, "Error loading snapshot: %s", err.Error())
}
transporter.Install(s.raftServer, s)
@ -490,7 +490,7 @@ func (s *Server) writeHandler(w http.ResponseWriter, req *http.Request) {
startTime = time.Now()
failures, err := s.execute(transaction, stmts)
if err != nil {
log.Error("Database mutation failed: %s", err.Error())
log.Logf(log.ERROR, "Database mutation failed: %s", err.Error())
http.Error(w, err.Error(), http.StatusInternalServerError)
return
}

Loading…
Cancel
Save