Apply go fix -any ./...

This commit is contained in:
Michael Eischer
2026-07-22 22:25:18 +02:00
parent d4088aa09b
commit 32e9869cc8
63 changed files with 197 additions and 197 deletions
+2 -2
View File
@@ -30,11 +30,11 @@ func NewJSONProgress(term ui.Terminal, verbosity uint) ProgressPrinter {
}
}
func (b *jsonProgress) print(status interface{}) {
func (b *jsonProgress) print(status any) {
b.term.Print(ui.ToJSONString(status))
}
func (b *jsonProgress) error(status interface{}) {
func (b *jsonProgress) error(status any) {
b.term.Error(ui.ToJSONString(status))
}
+1 -1
View File
@@ -100,7 +100,7 @@ func ParseBytes(s string) (int64, error) {
return value, nil
}
func ToJSONString(status interface{}) string {
func ToJSONString(status any) string {
buf := new(bytes.Buffer)
err := json.NewEncoder(buf).Encode(status)
if err != nil {
+6 -6
View File
@@ -66,33 +66,33 @@ func (t *terminalPrinter) NewCounterTerminalOnly(description string) restic.Coun
return newProgressMax(t.v > 0 && t.term.OutputIsTerminal(), 0, description, t.term)
}
func (t *terminalPrinter) E(msg string, args ...interface{}) {
func (t *terminalPrinter) E(msg string, args ...any) {
t.term.Error(fmt.Sprintf(msg, args...))
}
func (t *terminalPrinter) S(msg string, args ...interface{}) {
func (t *terminalPrinter) S(msg string, args ...any) {
t.term.Print(fmt.Sprintf(msg, args...))
}
func (t *terminalPrinter) PT(msg string, args ...interface{}) {
func (t *terminalPrinter) PT(msg string, args ...any) {
if t.term.OutputIsTerminal() && t.v >= 1 {
t.term.Print(fmt.Sprintf(msg, args...))
}
}
func (t *terminalPrinter) P(msg string, args ...interface{}) {
func (t *terminalPrinter) P(msg string, args ...any) {
if t.v >= 1 {
t.term.Print(fmt.Sprintf(msg, args...))
}
}
func (t *terminalPrinter) V(msg string, args ...interface{}) {
func (t *terminalPrinter) V(msg string, args ...any) {
if t.v >= 2 {
t.term.Print(fmt.Sprintf(msg, args...))
}
}
func (t *terminalPrinter) VV(msg string, args ...interface{}) {
func (t *terminalPrinter) VV(msg string, args ...any) {
if t.v >= 3 {
t.term.Print(fmt.Sprintf(msg, args...))
}
+2 -2
View File
@@ -24,11 +24,11 @@ func NewJSONProgress(terminal ui.Terminal, verbosity uint) ProgressPrinter {
}
}
func (t *jsonPrinter) print(status interface{}) {
func (t *jsonPrinter) print(status any) {
t.terminal.Print(ui.ToJSONString(status))
}
func (t *jsonPrinter) error(status interface{}) {
func (t *jsonPrinter) error(status any) {
t.terminal.Error(ui.ToJSONString(status))
}
+2 -2
View File
@@ -13,7 +13,7 @@ import (
type Table struct {
columns []string
templates []*template.Template
data []interface{}
data []any
footer []string
CellSeparator string
@@ -58,7 +58,7 @@ func (t *Table) AddColumn(header, format string) {
}
// AddRow adds a new row to the table, which is filled with data.
func (t *Table) AddRow(data interface{}) {
func (t *Table) AddRow(data any) {
t.data = append(t.data, data)
}