Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): bump github.com/hibare/GoCommon/v2 from 2.6.0 to 2.13.0 in the go group #205

Merged
merged 2 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions cmd/backup/backup.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
package backup

import (
"errors"
"log/slog"

log "github.com/rs/zerolog/log"
"github.com/spf13/cobra"
)

Expand All @@ -12,9 +11,8 @@ var BackupCmd = &cobra.Command{
Short: "Perform backups & related operations",
Long: "",
Run: func(cmd *cobra.Command, args []string) {
log.Error().Err(errors.New("test error")).Msg("Printing help")
if err := cmd.Help(); err != nil {
log.Error().Err(err).Msg("error printing help")
slog.Error("error printing help")
}
},
}
Expand Down
5 changes: 3 additions & 2 deletions cmd/config/clean.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package config

import (
"log/slog"

"github.com/hibare/GoS3Backup/internal/config"
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
)

Expand All @@ -11,7 +12,7 @@ var CleanConfigCmd = &cobra.Command{
Short: "Command to clean up program config",
Run: func(cmd *cobra.Command, args []string) {
if err := config.CleanConfig(); err != nil {
log.Error().Err(err).Msg("error cleaning config")
slog.Error("error cleaning config", "error", err)
}
},
}
14 changes: 7 additions & 7 deletions cmd/root.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cmd

import (
"log/slog"
"os"
"time"

Expand All @@ -12,7 +13,6 @@ import (
"github.com/hibare/GoS3Backup/internal/config"
"github.com/hibare/GoS3Backup/internal/constants"
"github.com/hibare/GoS3Backup/internal/version"
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
)

Expand All @@ -30,15 +30,15 @@ var rootCmd = &cobra.Command{
intBackup.Backup()
intBackup.PurgeOldBackups()
}); err != nil {
log.Error().Err(err).Msg("Error setting up cron")
slog.Error("Error setting up cron")
}
log.Info().Msgf("Scheduled backup job to run every %s", config.Current.Backup.Cron)
slog.Info("Scheduled backup job", "cron", config.Current.Backup.Cron)

// Schedule version check job
if _, err := s.Cron(constants.VersioCheckCron).Do(func() {
if _, err := s.Cron(constants.VersionCheckCron).Do(func() {
version.V.CheckUpdate()
}); err != nil {
log.Warn().Err(err).Msg("Failed to schedule version check job")
slog.Warn("Failed to schedule version check job")
}

s.StartBlocking()
Expand All @@ -56,12 +56,12 @@ func init() {
rootCmd.AddCommand(configCmd.ConfigCmd)
rootCmd.AddCommand(backup.BackupCmd)

cobra.OnInitialize(commonLogger.InitLogger, config.LoadConfig)
cobra.OnInitialize(commonLogger.InitDefaultLogger, config.LoadConfig)

initialVersionCheck := func() {
version.V.CheckUpdate()
if version.V.NewVersionAvailable {
log.Info().Msg(version.V.GetUpdateNotification())
slog.Info(version.V.GetUpdateNotification())
}
}
go initialVersionCheck()
Expand Down
25 changes: 11 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,39 @@ go 1.22

require (
github.com/go-co-op/gocron v1.37.0
github.com/hibare/GoCommon/v2 v2.6.0
github.com/hibare/GoCommon/v2 v2.13.0
github.com/jedib0t/go-pretty/v6 v6.5.9
github.com/rs/zerolog v1.33.0
github.com/spf13/cobra v1.8.1
)

require (
github.com/ProtonMail/go-crypto v0.0.0-20230717121422-5aa5874ade95 // indirect
github.com/aws/aws-sdk-go v1.48.10 // indirect
github.com/ProtonMail/go-crypto v1.1.0-alpha.5-proton // indirect
github.com/aws/aws-sdk-go v1.55.3 // indirect
github.com/cloudflare/circl v1.3.7 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/google/uuid v1.4.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/robfig/cron/v3 v3.0.1 // indirect
github.com/sagikazarmark/locafero v0.3.0 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.10.0 // indirect
github.com/spf13/cast v1.5.1 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.17.0 // indirect
github.com/spf13/viper v1.19.0 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
golang.org/x/crypto v0.17.0 // indirect
golang.org/x/crypto v0.21.0 // indirect
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/sys v0.17.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
Expand Down
Loading
Loading