Merge pull request #7932 from gyuho/vet

*: remove unnecessary fmt.Sprint
release-3.2
Gyu-Ho Lee 2017-05-15 14:01:23 -07:00 committed by GitHub
commit 95078c296d
2 changed files with 5 additions and 6 deletions

View File

@ -167,10 +167,10 @@ func makeEndpointStatusTable(statusList []epStatus) (hdr []string, rows [][]stri
hdr = []string{"endpoint", "ID", "version", "db size", "is leader", "raft term", "raft index"}
for _, status := range statusList {
rows = append(rows, []string{
fmt.Sprint(status.Ep),
status.Ep,
fmt.Sprintf("%x", status.Resp.Header.MemberId),
fmt.Sprint(status.Resp.Version),
fmt.Sprint(humanize.Bytes(uint64(status.Resp.DbSize))),
status.Resp.Version,
humanize.Bytes(uint64(status.Resp.DbSize)),
fmt.Sprint(status.Resp.Leader == status.Resp.Header.MemberId),
fmt.Sprint(status.Resp.RaftTerm),
fmt.Sprint(status.Resp.RaftIndex),

View File

@ -15,7 +15,6 @@
package main
import (
"fmt"
"os"
"os/exec"
"path/filepath"
@ -232,9 +231,9 @@ func existDir(fpath string) bool {
}
func archiveLogAndDataDir(logDir string, datadir string) error {
dir := filepath.Join(logDir, "failure_archive", fmt.Sprint(time.Now().Format(time.RFC3339)))
dir := filepath.Join(logDir, "failure_archive", time.Now().Format(time.RFC3339))
if existDir(dir) {
dir = filepath.Join(logDir, "failure_archive", fmt.Sprint(time.Now().Add(time.Second).Format(time.RFC3339)))
dir = filepath.Join(logDir, "failure_archive", time.Now().Add(time.Second).Format(time.RFC3339))
}
if err := fileutil.TouchDirAll(dir); err != nil {
return err