Skip to content

Commit

Permalink
Merge pull request #548 from Hoega/exportloopref-linter
Browse files Browse the repository at this point in the history
Add Exportloopref linter and fix errors
  • Loading branch information
nkwangleiGIT authored Jan 30, 2024
2 parents 2c02f39 + da5317d commit 7f60cc0
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ linters:
disable-all: false # in contrast to golangci.yaml, the default set of linters remains enabled
enable: # please keep this alphabetized and in sync with golangci.yaml
- dupword # add by kubeagi
- exportloopref
- ginkgolinter
- gci # add by kubeagi
- gocritic
Expand Down
1 change: 1 addition & 0 deletions apiserver/pkg/dataset/dataset.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ func dataset2model(obj *unstructured.Unstructured) (*generated.Dataset, error) {
ds.Field = &dataset.Spec.Field
first := true
for _, cond := range dataset.Status.Conditions {
cond := cond
if !cond.LastSuccessfulTime.IsZero() {
if first || ds.UpdateTimestamp.Before(cond.LastTransitionTime.Time) {
ds.UpdateTimestamp = &cond.LastTransitionTime.Time
Expand Down
1 change: 1 addition & 0 deletions apiserver/pkg/ray/raycluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ func ListRayClusters(ctx context.Context, c dynamic.Interface, input generated.L

var results = make([]generated.PageNode, 0, len(clusters))
for index, cluster := range clusters {
cluster := cluster
// skip if keyword not in cluster name
if input.Keyword != nil {
if !strings.Contains(cluster.Name, *input.Keyword) {
Expand Down
1 change: 1 addition & 0 deletions apiserver/pkg/versioneddataset/versioned_dataset.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ func versionedDataset2model(obj *unstructured.Unstructured) (*generated.Versione
vds.DataProcessMsg = new(string)
first := true
for _, cond := range versioneddataset.Status.Conditions {
cond := cond
if cond.Type == v1alpha1.TypeReady {
*vds.SyncStatus = string(cond.Reason)
*vds.SyncMsg = cond.Message
Expand Down

0 comments on commit 7f60cc0

Please sign in to comment.