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
+1 -1
View File
@@ -42,7 +42,7 @@ func ParseVSSConfig(o options.Options) (VSSConfig, error) {
type ErrorHandler func(item string, err error)
// MessageHandler is used to report errors/messages via callbacks.
type MessageHandler func(msg string, args ...interface{})
type MessageHandler func(msg string, args ...any)
// volumeFilter is used to filter volumes by their mount point or GUID path.
type volumeFilter func(volume string) bool
+1 -1
View File
@@ -28,7 +28,7 @@ type commandReader struct {
alreadyClosedReadErr error
}
func NewCommandReader(ctx context.Context, args []string, errorOutput func(msg string, args ...interface{})) (io.ReadCloser, error) {
func NewCommandReader(ctx context.Context, args []string, errorOutput func(msg string, args ...any)) (io.ReadCloser, error) {
if len(args) == 0 {
return nil, fmt.Errorf("no command was specified as argument")
}
+6 -6
View File
@@ -13,7 +13,7 @@ import (
)
func TestCommandReaderSuccess(t *testing.T) {
reader, err := fs.NewCommandReader(context.TODO(), []string{"true"}, func(msg string, args ...interface{}) {})
reader, err := fs.NewCommandReader(context.TODO(), []string{"true"}, func(msg string, args ...any) {})
test.OK(t, err)
_, err = io.Copy(io.Discard, reader)
@@ -23,7 +23,7 @@ func TestCommandReaderSuccess(t *testing.T) {
}
func TestCommandReaderFail(t *testing.T) {
reader, err := fs.NewCommandReader(context.TODO(), []string{"false"}, func(msg string, args ...interface{}) {})
reader, err := fs.NewCommandReader(context.TODO(), []string{"false"}, func(msg string, args ...any) {})
test.OK(t, err)
_, err = io.Copy(io.Discard, reader)
@@ -31,17 +31,17 @@ func TestCommandReaderFail(t *testing.T) {
}
func TestCommandReaderInvalid(t *testing.T) {
_, err := fs.NewCommandReader(context.TODO(), []string{"w54fy098hj7fy5twijouytfrj098y645wr"}, func(msg string, args ...interface{}) {})
_, err := fs.NewCommandReader(context.TODO(), []string{"w54fy098hj7fy5twijouytfrj098y645wr"}, func(msg string, args ...any) {})
test.Assert(t, err != nil, "missing error")
}
func TestCommandReaderEmptyArgs(t *testing.T) {
_, err := fs.NewCommandReader(context.TODO(), []string{}, func(msg string, args ...interface{}) {})
_, err := fs.NewCommandReader(context.TODO(), []string{}, func(msg string, args ...any) {})
test.Assert(t, err != nil, "missing error")
}
func TestCommandReaderOutput(t *testing.T) {
reader, err := fs.NewCommandReader(context.TODO(), []string{"echo", "hello world"}, func(msg string, args ...interface{}) {})
reader, err := fs.NewCommandReader(context.TODO(), []string{"echo", "hello world"}, func(msg string, args ...any) {})
test.OK(t, err)
var buf bytes.Buffer
@@ -56,7 +56,7 @@ func TestCommandReaderOutput(t *testing.T) {
func TestCommandReaderQuickClose(t *testing.T) {
ctx, cancel := context.WithTimeout(context.TODO(), 10*time.Second)
defer cancel()
reader, err := fs.NewCommandReader(ctx, []string{"sleep", "3600"}, func(msg string, args ...interface{}) {})
reader, err := fs.NewCommandReader(ctx, []string{"sleep", "3600"}, func(msg string, args ...any) {})
test.OK(t, err)
// test that close returns before the context expires
+1 -1
View File
@@ -122,7 +122,7 @@ func TestOverwriteXattrWithSelectFilter(t *testing.T) {
file := filepath.Join(dir, "file2")
rtest.OK(t, os.WriteFile(file, []byte("hello world"), 0o600))
noopWarnf := func(_ string, _ ...interface{}) {}
noopWarnf := func(_ string, _ ...any) {}
// Set a filter as if the user passed in --include-xattr user.*
xattrSelectFilter1 := func(xattrName string) bool {