Skip to content

Commit

Permalink
Fix part of lint/go errors (misspell, depguard, unconvert) (#4621)
Browse files Browse the repository at this point in the history
* Fix lint/go errors (misspell)

Signed-off-by: karamaru-alpha <[email protected]>

* Fix lint/go errors (depguard)

Signed-off-by: karamaru-alpha <[email protected]>

* Fix lint/go errors (unconvert)

Signed-off-by: karamaru-alpha <[email protected]>

---------

Signed-off-by: karamaru-alpha <[email protected]>
  • Loading branch information
karamaru-alpha authored Oct 18, 2023
1 parent 8c202c7 commit 4ed62fb
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion pkg/app/pipectl/client/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func WaitDeploymentStatuses(
func makeDeploymentStatusesMap(statuses []model.DeploymentStatus) map[model.DeploymentStatus]struct{} {
out := make(map[model.DeploymentStatus]struct{}, len(statuses))
for _, s := range statuses {
out[model.DeploymentStatus(s)] = struct{}{}
out[(s)] = struct{}{}
}
return out
}
2 changes: 1 addition & 1 deletion pkg/app/piped/apistore/applicationstore/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ package applicationstore

import (
"context"
"sync/atomic"
"time"

"go.uber.org/atomic"
"go.uber.org/zap"
"google.golang.org/grpc"

Expand Down
2 changes: 1 addition & 1 deletion pkg/app/piped/apistore/deploymentstore/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ package deploymentstore

import (
"context"
"sync/atomic"
"time"

"go.uber.org/atomic"
"go.uber.org/zap"
"google.golang.org/grpc"

Expand Down
2 changes: 1 addition & 1 deletion pkg/app/piped/apistore/eventstore/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ package eventstore
import (
"context"
"fmt"
"sync/atomic"
"time"

"go.uber.org/atomic"
"go.uber.org/zap"
"google.golang.org/grpc"

Expand Down
4 changes: 2 additions & 2 deletions pkg/app/piped/platformprovider/terraform/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ package terraform

import (
"fmt"
"io/ioutil"
"os"
"path/filepath"

"github.com/hashicorp/hcl/v2"
Expand Down Expand Up @@ -56,7 +56,7 @@ const tfFileExtension = ".tf"

// LoadTerraformFiles loads terraform files from a given dir.
func LoadTerraformFiles(dir string) ([]File, error) {
fileInfos, err := ioutil.ReadDir(dir)
fileInfos, err := os.ReadDir(dir)
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/piped.go
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ type PlatformProviderTerraformConfig struct {
// 'image_id_map={"us-east-1":"ami-abc123","us-east-2":"ami-def456"}'
Vars []string `json:"vars,omitempty"`
// Enable drift detection.
// TODO: This is a temporary option because Terraform drift detection is buggy and has performace issues. This will be possibly removed in the future release.
// TODO: This is a temporary option because Terraform drift detection is buggy and has performance issues. This will be possibly removed in the future release.
DriftDetectionEnabled *bool `json:"driftDetectionEnabled" default:"true"`
}

Expand Down
4 changes: 2 additions & 2 deletions pkg/datastore/deploymentstore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -484,7 +484,7 @@ func TestMergeMetadata(t *testing.T) {
expected: map[string]string{},
},
{
name: "ori map is emtpy",
name: "ori map is empty",
new: map[string]string{
"key-1": "value-1",
},
Expand All @@ -493,7 +493,7 @@ func TestMergeMetadata(t *testing.T) {
},
},
{
name: "new map is emtpy",
name: "new map is empty",
ori: map[string]string{
"key-1": "value-1",
},
Expand Down
2 changes: 1 addition & 1 deletion pkg/datastore/filedb/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func filter(col datastore.Collection, e interface{}, filters []datastore.ListFil
}

val, ok := omap[field]
// If the object does not contain given field name in filter, return false immidiately.
// If the object does not contain given field name in filter, return false immediately.
if !ok {
return false, nil
}
Expand Down
6 changes: 3 additions & 3 deletions pkg/diff/renderer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func TestRenderNodeValue(t *testing.T) {
expected: "hello",
},
{
name: "slice of primative elements",
name: "slice of primitive elements",
value: func() reflect.Value {
v := []int{1, 2, 3}
return reflect.ValueOf(v)
Expand Down Expand Up @@ -110,7 +110,7 @@ two: two-value`,
v := map[string]interface{}{
"1-number": 1,
"2-string": "hello",
"3-map-of-primative": mapOfPrimative,
"3-map-of-primitive": mapOfPrimative,
"4-map-of-map": mapOfMap,
"5-map-of-slice": mapOfSlice,
"6-slice": []string{"a", "b"},
Expand All @@ -120,7 +120,7 @@ two: two-value`,
}(),
expected: `1-number: 1
2-string: hello
3-map-of-primative:
3-map-of-primitive:
one: 1
two: 2
4-map-of-map:
Expand Down

0 comments on commit 4ed62fb

Please sign in to comment.