refactor: refactoring of code to meet all golangci-lint requirements

This commit is contained in:
Jonas Kaninda
2024-11-19 02:54:31 +01:00
parent d97a0aafea
commit 63101ae84f
20 changed files with 413 additions and 313 deletions

View File

@@ -1,5 +1,6 @@
// Package cmd /
/*****
/*
****
@author Jonas Kaninda
@license MIT License <https://opensource.org/licenses/MIT>
@Copyright © 2024 Jonas Kaninda
@@ -8,6 +9,7 @@ package cmd
import (
"github.com/jkaninda/pg-bkup/internal"
"github.com/jkaninda/pg-bkup/pkg/logger"
"github.com/jkaninda/pg-bkup/utils"
"github.com/spf13/cobra"
)
@@ -20,7 +22,7 @@ var RestoreCmd = &cobra.Command{
if len(args) == 0 {
internal.StartRestore(cmd)
} else {
utils.Fatal(`"restore" accepts no argument %q`, args)
logger.Fatal(`"restore" accepts no argument %q`, args)
}
@@ -28,7 +30,7 @@ var RestoreCmd = &cobra.Command{
}
func init() {
//Restore
// Restore
RestoreCmd.PersistentFlags().StringP("file", "f", "", "File name of database")
RestoreCmd.PersistentFlags().StringP("storage", "s", "local", "Define storage: local, s3, ssh, ftp")
RestoreCmd.PersistentFlags().StringP("path", "P", "", "AWS S3 path without file name. eg: /custom_path or ssh remote path `/home/foo/backup`")