mirror of
https://github.com/restic/restic.git
synced 2026-08-06 05:33:17 +00:00
Apply go fix -any ./...
This commit is contained in:
@@ -39,7 +39,7 @@ func findHash(buf []byte, filename string) (hash []byte, err error) {
|
||||
return nil, fmt.Errorf("hash for file %v not found", filename)
|
||||
}
|
||||
|
||||
func extractToFile(buf []byte, filename, target string, printf func(string, ...interface{})) error {
|
||||
func extractToFile(buf []byte, filename, target string, printf func(string, ...any)) error {
|
||||
var rd io.Reader = bytes.NewReader(buf)
|
||||
switch filepath.Ext(filename) {
|
||||
case ".bz2":
|
||||
@@ -112,9 +112,9 @@ func extractToFile(buf []byte, filename, target string, printf func(string, ...i
|
||||
// DownloadLatestStableRelease downloads the latest stable released version of
|
||||
// restic and saves it to target. It returns the version string for the newest
|
||||
// version. The function printf is used to print progress information.
|
||||
func DownloadLatestStableRelease(ctx context.Context, target, currentVersion string, printf func(string, ...interface{})) (version string, err error) {
|
||||
func DownloadLatestStableRelease(ctx context.Context, target, currentVersion string, printf func(string, ...any)) (version string, err error) {
|
||||
if printf == nil {
|
||||
printf = func(string, ...interface{}) {}
|
||||
printf = func(string, ...any) {}
|
||||
}
|
||||
|
||||
printf("find latest release of restic at GitHub\n")
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
)
|
||||
|
||||
func TestExtractToFileZip(t *testing.T) {
|
||||
printf := func(string, ...interface{}) {}
|
||||
printf := func(string, ...any) {}
|
||||
dir := t.TempDir()
|
||||
|
||||
ext := "zip"
|
||||
|
||||
@@ -156,7 +156,7 @@ func getGithubData(ctx context.Context, url string) ([]byte, error) {
|
||||
return buf, nil
|
||||
}
|
||||
|
||||
func getGithubDataFile(ctx context.Context, assets []Asset, suffix string, printf func(string, ...interface{})) (filename string, data []byte, err error) {
|
||||
func getGithubDataFile(ctx context.Context, assets []Asset, suffix string, printf func(string, ...any)) (filename string, data []byte, err error) {
|
||||
var url string
|
||||
for _, a := range assets {
|
||||
if strings.HasSuffix(a.Name, suffix) {
|
||||
|
||||
Reference in New Issue
Block a user