Skip to content

Commit

Permalink
fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
CCOLLOT committed Dec 18, 2023
1 parent 61efbc6 commit 31091ec
Show file tree
Hide file tree
Showing 34 changed files with 35 additions and 35 deletions.
1 change: 0 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import (
)

var (
debug bool
configFilePath string
logLevel string
logFormat string
Expand Down
4 changes: 2 additions & 2 deletions cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cmd

import (
"fmt"
"log/slog"
"os"
"os/signal"
"syscall"
Expand All @@ -13,7 +14,6 @@ import (
"github.com/qonto/upgrade-manager/internal/build"
"github.com/qonto/upgrade-manager/internal/infra/http"
"github.com/qonto/upgrade-manager/internal/infra/kubernetes"
"log/slog"
)

func Run() error {
Expand Down Expand Up @@ -79,7 +79,7 @@ func Run() error {
}

func buildLogger(level string, format string) *slog.Logger {
var programLevel = new(slog.LevelVar)
programLevel := new(slog.LevelVar)
switch level {
case "debug":
programLevel.Set(slog.LevelDebug)
Expand Down
2 changes: 1 addition & 1 deletion internal/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package app
import (
"context"
"fmt"
"log/slog"
"os"
"sync"
"time"
Expand All @@ -28,7 +29,6 @@ import (
"github.com/qonto/upgrade-manager/internal/app/sources/filesystemhelm"
"github.com/qonto/upgrade-manager/internal/infra/aws"
"github.com/qonto/upgrade-manager/internal/infra/kubernetes"
"log/slog"
)

type App struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/app/calculators/candidate_count_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package calculators

import (
"log/slog"
"testing"

"github.com/qonto/upgrade-manager/internal/app/core/software"
"github.com/stretchr/testify/assert"
"log/slog"
)

func TestCandidateCountCalculateObsolescence(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/app/calculators/date_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package calculators

import (
"log/slog"
"testing"
"time"

s "github.com/qonto/upgrade-manager/internal/app/core/software"
"log/slog"
)

func TestDateCalculateObsolescenceScore(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/app/calculators/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ package calculators

import (
"fmt"
"log/slog"

goversion "github.com/hashicorp/go-version"
soft "github.com/qonto/upgrade-manager/internal/app/core/software"
"github.com/qonto/upgrade-manager/internal/app/semver"
"log/slog"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion internal/app/calculators/default_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package calculators

import (
"fmt"
"log/slog"
"testing"

s "github.com/qonto/upgrade-manager/internal/app/core/software"
"log/slog"
)

func TestCalculateObsolescenceScore(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion internal/app/calculators/meta.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package calculators

import (
"github.com/qonto/upgrade-manager/internal/app/core/software"
"log/slog"

"github.com/qonto/upgrade-manager/internal/app/core/software"
)

var calculatorCache = make(map[software.CalculatorType]software.Calculator)
Expand Down
2 changes: 1 addition & 1 deletion internal/app/calculators/meta_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package calculators

import (
"fmt"
"log/slog"
"testing"

s "github.com/qonto/upgrade-manager/internal/app/core/software"
"log/slog"
)

func TestMetaCalculateObsolescenceScore(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/app/sources/argohelm/git_credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package argohelm
import (
"context"
"fmt"
"log/slog"
"regexp"
"strconv"
"time"
Expand All @@ -11,7 +12,6 @@ import (
"github.com/go-git/go-git/v5/plumbing/transport/ssh"
"github.com/qonto/upgrade-manager/internal/app/sources/utils/gitutils"
k8sClient "github.com/qonto/upgrade-manager/internal/infra/kubernetes"
"log/slog"
)

// Retrieve all git credentials in the namespace which have "repo" in their name
Expand Down
2 changes: 1 addition & 1 deletion internal/app/sources/argohelm/git_credentials_test.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package argohelm

import (
"log/slog"
"os"
"regexp"
"testing"

"github.com/qonto/upgrade-manager/internal/infra/kubernetes"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"log/slog"
)

func TestGetGitCredentialSecretsFromNamespace(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/app/sources/argohelm/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package argohelm
import (
"context"
"fmt"
"log/slog"
"os"
"regexp"
"strconv"
Expand All @@ -18,7 +19,6 @@ import (
"github.com/qonto/upgrade-manager/internal/infra/aws"
"github.com/qonto/upgrade-manager/internal/infra/kubernetes"
"helm.sh/helm/v3/pkg/chart"
"log/slog"
)

const ArgoHelm soft.SoftwareType = "argoHelm"
Expand Down
2 changes: 1 addition & 1 deletion internal/app/sources/argohelm/source_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package argohelm

import (
"log/slog"
"testing"

"github.com/go-git/go-git/v5/plumbing/transport/http"
"github.com/qonto/upgrade-manager/internal/app/sources/utils/gitutils"
"log/slog"
)

func TestMatchGitRepoConnection(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/app/sources/aws/eks/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ package eks
import (
"context"
"fmt"
"log/slog"
"time"

"github.com/aws/aws-sdk-go-v2/service/eks"
"github.com/qonto/upgrade-manager/internal/app/core/software"
"github.com/qonto/upgrade-manager/internal/app/filters"
"github.com/qonto/upgrade-manager/internal/app/semver"
"github.com/qonto/upgrade-manager/internal/infra/aws"
"log/slog"
)

type Source struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/app/sources/aws/eks/source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package eks

import (
"fmt"
"log/slog"
"testing"

"github.com/aws/aws-sdk-go-v2/aws"
Expand All @@ -10,7 +11,6 @@ import (
"github.com/qonto/upgrade-manager/internal/app/core/software"
"github.com/qonto/upgrade-manager/internal/app/filters"
awsInfra "github.com/qonto/upgrade-manager/internal/infra/aws"
"log/slog"
)

func TestLoad(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/app/sources/aws/elasticache/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ package elasticache

import (
"context"
"log/slog"
"time"

"github.com/aws/aws-sdk-go-v2/service/elasticache"
"github.com/aws/aws-sdk-go-v2/service/elasticache/types"
"github.com/qonto/upgrade-manager/internal/app/core/software"
"github.com/qonto/upgrade-manager/internal/app/filters"
"github.com/qonto/upgrade-manager/internal/infra/aws"
"log/slog"
)

type VersionProvider struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/app/sources/aws/elasticache/provider_test.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package elasticache

import (
"log/slog"
"testing"

"github.com/qonto/upgrade-manager/internal/app/core/software"
"github.com/qonto/upgrade-manager/internal/app/filters"
"github.com/qonto/upgrade-manager/internal/infra/aws"
"log/slog"
)

func TestLoad(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/app/sources/aws/elasticache/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ package elasticache
import (
"context"
"fmt"
"log/slog"
"time"

"github.com/aws/aws-sdk-go-v2/service/elasticache"
"github.com/qonto/upgrade-manager/internal/app/core/software"
"github.com/qonto/upgrade-manager/internal/app/filters"
"github.com/qonto/upgrade-manager/internal/infra/aws"
"log/slog"
)

type Source struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/app/sources/aws/elasticache/source_test.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package elasticache

import (
"log/slog"
"testing"

"github.com/qonto/upgrade-manager/internal/app/filters"
"github.com/qonto/upgrade-manager/internal/infra/aws"
"log/slog"
)

func TestSourceLoad(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/app/sources/aws/lambda/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ package lambda

import (
"context"
"log/slog"
"time"

"github.com/aws/aws-sdk-go-v2/service/lambda"
"github.com/aws/aws-sdk-go-v2/service/lambda/types"
"github.com/qonto/upgrade-manager/internal/app/core/software"
"github.com/qonto/upgrade-manager/internal/infra/aws"
"log/slog"
)

type Source struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/app/sources/aws/lambda/source_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package lambda

import (
"errors"
"log/slog"
"testing"

"github.com/aws/aws-sdk-go-v2/service/lambda"
Expand All @@ -11,7 +12,6 @@ import (
"github.com/qonto/upgrade-manager/internal/infra/aws"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"log/slog"
)

func TestLoad(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/app/sources/aws/msk/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ package msk

import (
"context"
"log/slog"
"strings"
"time"

"github.com/aws/aws-sdk-go-v2/service/kafka"
"github.com/qonto/upgrade-manager/internal/app/core/software"
"github.com/qonto/upgrade-manager/internal/app/filters"
"github.com/qonto/upgrade-manager/internal/infra/aws"
"log/slog"
)

type Source struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/app/sources/aws/msk/source_test.go
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package msk

import (
"log/slog"
"testing"

"github.com/aws/aws-sdk-go-v2/service/kafka"
"github.com/aws/aws-sdk-go-v2/service/kafka/types"
"github.com/qonto/upgrade-manager/internal/app/sources/utils"
"github.com/qonto/upgrade-manager/internal/infra/aws"
"github.com/stretchr/testify/mock"
"log/slog"
)

func TestLoad(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/app/sources/aws/rds/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ package rds
import (
"context"
"fmt"
"log/slog"
"time"

"github.com/aws/aws-sdk-go-v2/service/rds"
"github.com/qonto/upgrade-manager/internal/app/core/software"
"github.com/qonto/upgrade-manager/internal/app/filters"
"github.com/qonto/upgrade-manager/internal/infra/aws"
"log/slog"
)

type Source struct {
Expand Down
2 changes: 1 addition & 1 deletion internal/app/sources/aws/rds/source_test.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package rds

import (
"log/slog"
"testing"

"github.com/aws/aws-sdk-go-v2/service/rds"
"github.com/aws/aws-sdk-go-v2/service/rds/types"
"github.com/qonto/upgrade-manager/internal/infra/aws"
"github.com/stretchr/testify/assert"
"log/slog"
)

func TestLoad(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion internal/app/sources/deployments/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package deployments
import (
"context"
"fmt"
"log/slog"
"strings"
"time"

Expand All @@ -12,7 +13,6 @@ import (
"github.com/qonto/upgrade-manager/internal/app/filters"
"github.com/qonto/upgrade-manager/internal/infra/kubernetes"
"github.com/qonto/upgrade-manager/internal/infra/registry"
"log/slog"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion internal/app/sources/deployments/source_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package deployments

import (
"log/slog"
"testing"

"github.com/qonto/upgrade-manager/internal/app/core/software"
Expand All @@ -10,7 +11,6 @@ import (
appsv1 "k8s.io/api/apps/v1"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"log/slog"
)

func createDeployment(image string, deploymentName string, containerName string, calculator software.CalculatorType) appsv1.Deployment {
Expand Down
Loading

0 comments on commit 31091ec

Please sign in to comment.