Skip to content

Commit

Permalink
Fix format/imports with goimport
Browse files Browse the repository at this point in the history
  • Loading branch information
acbox committed May 11, 2023
1 parent c70596a commit e3ae45e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pkg/sloop/common/utilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ func Truncate(text string, width int, delimiter ...string) (string, error) {
return text, nil
}
r := []rune(text)
truncated := r[:(Max(width, d_len)-d_len)]
truncated := r[:(Max(width, d_len) - d_len)]
return string(truncated) + d, nil
}
14 changes: 7 additions & 7 deletions pkg/sloop/ingress/kubewatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,17 @@
package ingress

import (
"bytes"
"context"
"encoding/json"
"fmt"
"reflect"
"strings"
"sync"
"sync/atomic"
"time"
"bytes"
"strings"
"reflect"

"github.com/diegoholiveira/jsonlogic/v3"
"github.com/golang/glog"
"github.com/golang/protobuf/ptypes"
"github.com/pkg/errors"
Expand All @@ -35,7 +36,6 @@ import (
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/cache"
"github.com/diegoholiveira/jsonlogic/v3"
)

/*
Expand Down Expand Up @@ -373,18 +373,18 @@ func (i *kubeWatcherImpl) refreshCrdInformers(masterURL string, kubeContext stri
}
}

func (i *kubeWatcherImpl) getExclusionRules(kind string) ([]any) {
func (i *kubeWatcherImpl) getExclusionRules(kind string) []any {
kindRules, _ := i.exclusionRules[kind]
globalRules, _ := i.exclusionRules["_all"]
combinedRules := append(
kindRules,
globalRules...
globalRules...,
)
glog.V(common.GlogVerbose).Infof("Fetched rules: %s", combinedRules)
return combinedRules
}

func (i *kubeWatcherImpl) eventExcluded(kind string, resourceJson string) (bool) {
func (i *kubeWatcherImpl) eventExcluded(kind string, resourceJson string) bool {
filters := i.getExclusionRules(kind)
for _, logic := range filters {
logicJson, err := json.Marshal(logic)
Expand Down

0 comments on commit e3ae45e

Please sign in to comment.