Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
jakeschuurmans committed Sep 25, 2023
1 parent 27468e5 commit befda1e
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 17 deletions.
6 changes: 3 additions & 3 deletions internal/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import (
"os"

"github.com/bmc-toolbox/common"
"github.com/sirupsen/logrus"
"github.com/spf13/viper"
"github.com/metal-toolbox/firmware-syncer/internal/config"
"github.com/metal-toolbox/firmware-syncer/internal/vendors"
"github.com/metal-toolbox/firmware-syncer/internal/vendors/asrockrack"
Expand All @@ -15,6 +13,8 @@ import (
"github.com/metal-toolbox/firmware-syncer/internal/vendors/intel"
"github.com/metal-toolbox/firmware-syncer/internal/vendors/mellanox"
"github.com/metal-toolbox/firmware-syncer/internal/vendors/supermicro"
"github.com/sirupsen/logrus"
"github.com/spf13/viper"
)

var (
Expand Down Expand Up @@ -51,9 +51,9 @@ func New(configFile string, logLevel int) (*Syncer, error) {
v.SetConfigFile("config.yaml")
v.AddConfigPath(".")
err := v.ReadInConfig()

if err != nil {
logger.Error("Failed to find viper config file")
// return nil, err
}

// Load configuration
Expand Down
8 changes: 4 additions & 4 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import (
"strings"
"time"

"gopkg.in/yaml.v2"
"github.com/spf13/viper"
"github.com/sirupsen/logrus"
"github.com/spf13/viper"
"gopkg.in/yaml.v2"

serverservice "go.hollow.sh/serverservice/pkg/api/v1"
)
Expand Down Expand Up @@ -149,11 +149,11 @@ func ParseRepositoryURL(repositoryURL string) (endpoint, bucket string, err erro
return u.Host, bucket, nil
}

func LoadEnvironmentVariable(v* viper.Viper, logger *logrus.Logger, key string) (string) {
func LoadEnvironmentVariable(v *viper.Viper, logger *logrus.Logger, key string) string {
val := v.Get(key)
if val == nil {
logger.Warnf("Failed to find %s in config.yaml", key)
}

return val.(string)
}
}
6 changes: 3 additions & 3 deletions internal/inventory/serverservice.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import (
"github.com/metal-toolbox/firmware-syncer/internal/config"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"golang.org/x/exp/slices"
"golang.org/x/oauth2/clientcredentials"
"github.com/spf13/viper"
serverservice "go.hollow.sh/serverservice/pkg/api/v1"
"golang.org/x/exp/slices"
"golang.org/x/oauth2/clientcredentials"
)

var (
Expand All @@ -27,7 +27,7 @@ type ServerService struct {
logger *logrus.Logger
}

func New(ctx context.Context, serverServiceURL, artifactsURL string, logger *logrus.Logger, v* viper.Viper) (*ServerService, error) {
func New(ctx context.Context, serverServiceURL, artifactsURL string, logger *logrus.Logger, v *viper.Viper) (*ServerService, error) {
if artifactsURL == "" {
return nil, errors.New("missing artifacts URL")
}
Expand Down
4 changes: 2 additions & 2 deletions internal/vendors/asrockrack/asrockrack.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import (
"github.com/metal-toolbox/firmware-syncer/internal/config"
"github.com/metal-toolbox/firmware-syncer/internal/inventory"
"github.com/metal-toolbox/firmware-syncer/internal/vendors"
"github.com/spf13/viper"
"github.com/pkg/errors"
rcloneFs "github.com/rclone/rclone/fs"
rcloneOperations "github.com/rclone/rclone/fs/operations"
"github.com/sirupsen/logrus"
"github.com/spf13/viper"
serverservice "go.hollow.sh/serverservice/pkg/api/v1"
)

Expand All @@ -27,7 +27,7 @@ type ASRockRack struct {
tmpFs rcloneFs.Fs
}

func New(ctx context.Context, firmwares []*serverservice.ComponentFirmwareVersion, cfgSyncer *config.Syncer, logger *logrus.Logger, v* viper.Viper) (vendors.Vendor, error) {
func New(ctx context.Context, firmwares []*serverservice.ComponentFirmwareVersion, cfgSyncer *config.Syncer, logger *logrus.Logger, v *viper.Viper) (vendors.Vendor, error) {
// RepositoryURL required
if cfgSyncer.RepositoryURL == "" {
return nil, errors.Wrap(config.ErrProviderAttributes, "RepositoryURL not defined")
Expand Down
2 changes: 1 addition & 1 deletion internal/vendors/dell/dell.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type DUP struct {
}

// NewDUP returns a new DUP firmware syncer object
func NewDUP(ctx context.Context, firmwares []*serverservice.ComponentFirmwareVersion, cfgSyncer *config.Syncer, logger *logrus.Logger, v* viper.Viper) (vendors.Vendor, error) {
func NewDUP(ctx context.Context, firmwares []*serverservice.ComponentFirmwareVersion, cfgSyncer *config.Syncer, logger *logrus.Logger, v *viper.Viper) (vendors.Vendor, error) {
// RepositoryURL required
if cfgSyncer.RepositoryURL == "" {
return nil, errors.Wrap(config.ErrProviderAttributes, "RepositoryURL not defined")
Expand Down
2 changes: 1 addition & 1 deletion internal/vendors/equinix/equinix.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ type Equinix struct {
tmpFs fs.Fs
}

func New(ctx context.Context, firmwares []*serverservice.ComponentFirmwareVersion, cfgSyncer *config.Syncer, logger *logrus.Logger, v* viper.Viper) (vendors.Vendor, error) {
func New(ctx context.Context, firmwares []*serverservice.ComponentFirmwareVersion, cfgSyncer *config.Syncer, logger *logrus.Logger, v *viper.Viper) (vendors.Vendor, error) {
// RepositoryURL required
if cfgSyncer.RepositoryURL == "" {
return nil, errors.Wrap(config.ErrProviderAttributes, "RepositoryURL not defined")
Expand Down
2 changes: 1 addition & 1 deletion internal/vendors/intel/intel.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ type Intel struct {
tmpFs fs.Fs
}

func New(ctx context.Context, firmwares []*serverservice.ComponentFirmwareVersion, cfgSyncer *config.Syncer, logger *logrus.Logger, v* viper.Viper) (vendors.Vendor, error) {
func New(ctx context.Context, firmwares []*serverservice.ComponentFirmwareVersion, cfgSyncer *config.Syncer, logger *logrus.Logger, v *viper.Viper) (vendors.Vendor, error) {
// RepositoryURL required
if cfgSyncer.RepositoryURL == "" {
return nil, errors.Wrap(config.ErrProviderAttributes, "RepositoryURL not defined")
Expand Down
2 changes: 1 addition & 1 deletion internal/vendors/mellanox/mellanox.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type Mellanox struct {
inventory *inventory.ServerService
}

func New(ctx context.Context, firmwares []*serverservice.ComponentFirmwareVersion, cfgSyncer *config.Syncer, logger *logrus.Logger, v* viper.Viper) (vendors.Vendor, error) {
func New(ctx context.Context, firmwares []*serverservice.ComponentFirmwareVersion, cfgSyncer *config.Syncer, logger *logrus.Logger, v *viper.Viper) (vendors.Vendor, error) {
// RepositoryURL required
if cfgSyncer.RepositoryURL == "" {
return nil, errors.Wrap(config.ErrProviderAttributes, "RepositoryURL not defined")
Expand Down
2 changes: 1 addition & 1 deletion internal/vendors/supermicro/supermicro.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type Supermicro struct {
tmpFs fs.Fs
}

func New(ctx context.Context, firmwares []*serverservice.ComponentFirmwareVersion, cfgSyncer *config.Syncer, logger *logrus.Logger, v* viper.Viper) (vendors.Vendor, error) {
func New(ctx context.Context, firmwares []*serverservice.ComponentFirmwareVersion, cfgSyncer *config.Syncer, logger *logrus.Logger, v *viper.Viper) (vendors.Vendor, error) {
// RepositoryURL required
if cfgSyncer.RepositoryURL == "" {
return nil, errors.Wrap(config.ErrProviderAttributes, "RepositoryURL not defined")
Expand Down

0 comments on commit befda1e

Please sign in to comment.