mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #7932 from gyuho/vet
*: remove unnecessary fmt.Sprint
This commit is contained in:
commit
95078c296d
@ -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),
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user