mirror of
https://github.com/restic/restic.git
synced 2025-10-27 12:18:35 +00:00
Remove dead code
This removes dead code (functions that aren't called) detected with `deadcode`.
This commit is contained in:
@@ -29,11 +29,6 @@ func init() {
|
||||
}
|
||||
}
|
||||
|
||||
func dumpIndex(r *repository.Repository, wr io.Writer) error {
|
||||
fmt.Fprintln(wr, "foo")
|
||||
return nil
|
||||
}
|
||||
|
||||
func (cmd CmdDump) Usage() string {
|
||||
return "[index|snapshots|trees|all]"
|
||||
}
|
||||
|
||||
@@ -7,19 +7,11 @@ import (
|
||||
"os"
|
||||
"sort"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/restic/restic"
|
||||
"github.com/restic/restic/backend"
|
||||
)
|
||||
|
||||
const (
|
||||
minute = 60
|
||||
hour = 60 * minute
|
||||
day = 24 * hour
|
||||
week = 7 * day
|
||||
)
|
||||
|
||||
type Table struct {
|
||||
Header string
|
||||
Rows [][]interface{}
|
||||
@@ -55,23 +47,6 @@ func (t Table) Write(w io.Writer) error {
|
||||
|
||||
const TimeFormat = "2006-01-02 15:04:05"
|
||||
|
||||
func reltime(t time.Time) string {
|
||||
sec := uint64(time.Since(t).Seconds())
|
||||
|
||||
switch {
|
||||
case sec > week:
|
||||
return t.Format(TimeFormat)
|
||||
case sec > day:
|
||||
return fmt.Sprintf("%d days ago", sec/day)
|
||||
case sec > hour:
|
||||
return fmt.Sprintf("%d hours ago", sec/hour)
|
||||
case sec > minute:
|
||||
return fmt.Sprintf("%d minutes ago", sec/minute)
|
||||
default:
|
||||
return fmt.Sprintf("%d seconds ago", sec)
|
||||
}
|
||||
}
|
||||
|
||||
type CmdSnapshots struct {
|
||||
global *GlobalOptions
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user