Skip to content

Commit

Permalink
suggested by GoLand
Browse files Browse the repository at this point in the history
  • Loading branch information
Taimoor Ahmad committed Jan 21, 2024
1 parent dd59923 commit fdfb631
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/cmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/opslevel/opslevel-go/v2023"

"github.com/creasty/defaults"
git "github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5"
"github.com/rs/zerolog/log"
"github.com/spf13/cobra"
"github.com/spf13/viper"
Expand Down
6 changes: 3 additions & 3 deletions src/cmd/policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ func toASTValue[T astMarshallable](input T) (ast.Value, error) {
}

func getKeyFromMapByMaxValue(m map[string]float64) string {
max := float64(0)
maximum := float64(0)
var output string
for k, v := range m {
if v > max {
max = v
if v > maximum {
maximum = v
output = k
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/tag.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ opslevel get tag --type=Service my-service-alias foo
tags, err := result.GetTags(client, nil)
cobra.CheckErr(err)

output := []opslevel.Tag{}
output := make([]opslevel.Tag, 0)
for _, tag := range tags.Nodes {
if tagKey == tag.Key {
output = append(output, tag)
Expand Down
6 changes: 3 additions & 3 deletions src/cmd/terraform.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ provider "opslevel" {
graphqlClient := getClientGQL()

exportConstants(graphqlClient, constants)
exportRepos(graphqlClient, repos, bash)
exportRepos(graphqlClient, repos)
exportServices(graphqlClient, bash, directory)
exportTeams(graphqlClient, teams, bash)
exportFilters(graphqlClient, filters, bash)
Expand Down Expand Up @@ -182,7 +182,7 @@ func exportConstants(c *opslevel.Client, config *os.File) {
}
}

func exportRepos(c *opslevel.Client, config *os.File, shell *os.File) {
func exportRepos(c *opslevel.Client, config *os.File) {
repoConfig := `data "opslevel_repository" "%s" {
alias = "%s"
}
Expand All @@ -203,7 +203,7 @@ func flattenAliases(aliases []string) string {
}

func flattenTags(tags []opslevel.Tag) string {
tagStrings := []string{}
tagStrings := make([]string, 0)
for _, tag := range tags {
tagStrings = append(tagStrings, fmt.Sprintf("%s:%s", tag.Key, tag.Value))
}
Expand Down
8 changes: 4 additions & 4 deletions src/common/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ func YamlPrint(object interface{}) {
}

func MinInt(values ...int) int {
min := values[0]
minimum := values[0]

for _, val := range values {
if val < min {
min = val
if val < minimum {
minimum = val
}
}

return min
return minimum
}
2 changes: 1 addition & 1 deletion src/common/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package common_test
import (
"testing"

common "github.com/opslevel/cli/common"
"github.com/opslevel/cli/common"

"github.com/rocktavious/autopilot"
)
Expand Down
2 changes: 1 addition & 1 deletion src/common/output_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"strings"
"testing"

common "github.com/opslevel/cli/common"
"github.com/opslevel/cli/common"
"github.com/rocktavious/autopilot"
)

Expand Down
2 changes: 1 addition & 1 deletion src/common/prompts.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func PromptForIntegration(client *opslevel.Client) (*opslevel.Integration, error
{{ "Type:" | faint }} {{ .Type }}`,
}

filteredList := []opslevel.Integration{}
filteredList := make([]opslevel.Integration, 0)

Check warning on line 163 in src/common/prompts.go

View check run for this annotation

Codecov / codecov/patch

src/common/prompts.go#L163

Added line #L163 was not covered by tests
for _, val := range list {
if val.Type == "generic" {
filteredList = append(filteredList, val)
Expand Down
2 changes: 1 addition & 1 deletion src/submodules/opslevel-go
Submodule opslevel-go updated 76 files
+3 −0 .changes/unreleased/Bugfix-20231228-152233.yaml
+4 −0 .changes/unreleased/Bugfix-20231229-114751.yaml
+3 −0 .changes/unreleased/Bugfix-20231229-125723.yaml
+3 −0 .changes/unreleased/Bugfix-20240105-134240.yaml
+3 −0 .changes/unreleased/Bugfix-20240105-134510.yaml
+3 −0 .changes/unreleased/Deprecated-20240105-133239.yaml
+3 −0 .changes/unreleased/Feature-20231215-070846.yaml
+3 −0 .changes/unreleased/Feature-20231221-152309.yaml
+3 −0 .changes/unreleased/Feature-20231222-133813.yaml
+3 −0 .changes/unreleased/Feature-20231228-102445.yaml
+3 −0 .changes/unreleased/Feature-20240101-111338.yaml
+3 −0 .changes/unreleased/Feature-20240105-133214.yaml
+3 −0 .changes/unreleased/Feature-20240105-133632.yaml
+3 −0 .changes/unreleased/Feature-20240105-134016.yaml
+3 −0 .changes/unreleased/Feature-20240105-134114.yaml
+3 −0 .changes/unreleased/Feature-20240108-111215.yaml
+3 −0 .changes/unreleased/Feature-20240111-155211.yaml
+3 −0 .changes/unreleased/Feature-20240112-142046.yaml
+3 −0 .changes/unreleased/Refactor-20231221-113954.yaml
+4 −0 .changes/unreleased/Refactor-20231228-102145.yaml
+4 −0 .changes/unreleased/Refactor-20240109-202355.yaml
+3 −0 .changes/unreleased/Refactor-20240109-202941.yaml
+3 −0 .changes/unreleased/Refactor-20240109-205045.yaml
+3 −0 .changes/unreleased/Refactor-20240109-214205.yaml
+3 −0 .changes/unreleased/Refactor-20240110-142526.yaml
+3 −0 .changes/unreleased/Refactor-20240112-141014.yaml
+3 −0 .changes/unreleased/Removed-20240105-132834.yaml
+3 −0 .changes/unreleased/Removed-20240105-133921.yaml
+3 −0 .changes/unreleased/Removed-20240105-135133.yaml
+3 −0 .changes/unreleased/Removed-20240105-140214.yaml
+4 −0 .changes/unreleased/Removed-20240105-140438.yaml
+4 −0 .changes/unreleased/Removed-20240105-140526.yaml
+4 −0 .changes/unreleased/Removed-20240105-140553.yaml
+4 −0 .changes/unreleased/Removed-20240105-140610.yaml
+0 −43 .changes/v2024.1.13.md
+1 −1 .github/workflows/enum-gen.yaml
+2 −2 .github/workflows/release.yml
+4 −15 .github/workflows/tests.yml
+0 −41 CHANGELOG.md
+1 −1 README.md
+1 −1 actions_test.go
+1 −1 alert_source_test.go
+1 −1 cache_test.go
+1 −1 category_test.go
+1 −1 check_test.go
+1 −1 clientGQL_test.go
+1 −1 clientRest_test.go
+1 −1 common_test.go
+1 −1 dependencies_test.go
+1 −1 document_test.go
+1 −1 domain_test.go
+1 −1 examples/client.go
+1 −1 examples/mutation.go
+1 −1 examples/query.go
+1 −1 filters_test.go
+1 −1 gen.go
+2 −8 go.mod
+0 −12 go.sum
+1 −1 infra_test.go
+1 −1 integration_test.go
+1 −1 job_test.go
+1 −2 json_test.go
+1 −1 level_test.go
+1 −1 owner_test.go
+1 −1 property_test.go
+1 −1 repository_test.go
+1 −2 scalar_test.go
+1 −1 scorecards_test.go
+1 −1 secrets_test.go
+1 −1 service_test.go
+1 −1 system_test.go
+1 −1 tags_test.go
+1 −1 team_test.go
+1 −1 tools_test.go
+1 −1 user_test.go
+1 −1 version.go

0 comments on commit fdfb631

Please sign in to comment.