Skip to content

Commit

Permalink
chore(lint): apply linter
Browse files Browse the repository at this point in the history
Signed-off-by: Aldo Lacuku <[email protected]>
  • Loading branch information
alacuku authored and poiana committed Oct 16, 2024
1 parent dcd210e commit 3b9644b
Show file tree
Hide file tree
Showing 18 changed files with 43 additions and 36 deletions.
6 changes: 3 additions & 3 deletions cmd/bench.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ import (
"errors"
"time"

"github.com/falcosecurity/event-generator/pkg/counter"
"github.com/falcosecurity/event-generator/pkg/runner"

logger "github.com/sirupsen/logrus"
"github.com/spf13/cobra"

"github.com/falcosecurity/event-generator/pkg/counter"
"github.com/falcosecurity/event-generator/pkg/runner"
)

var errRoundDurationMustBeLongerThanSleep = errors.New("--round-duration must be longer than --sleep")
Expand Down
3 changes: 2 additions & 1 deletion cmd/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@ import (
"regexp"

"github.com/falcosecurity/client-go/pkg/client"
"github.com/falcosecurity/event-generator/events"
"github.com/spf13/pflag"

"github.com/falcosecurity/event-generator/events"
)

func parseEventsArg(arg string) (map[string]events.Action, error) {
Expand Down
3 changes: 2 additions & 1 deletion cmd/config_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ import (
"errors"

"github.com/creasty/defaults"
"github.com/falcosecurity/event-generator/cmd/internal/validate"
"github.com/go-playground/validator/v10"
logger "github.com/sirupsen/logrus"

"github.com/falcosecurity/event-generator/cmd/internal/validate"
)

// ConfigOptions represent the persistent configuration flags of event-generator.
Expand Down
6 changes: 3 additions & 3 deletions cmd/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ import (
"regexp"
"sort"

"github.com/spf13/cobra"

"github.com/falcosecurity/event-generator/events"
// register event collections
_ "github.com/falcosecurity/event-generator/events/k8saudit"
_ "github.com/falcosecurity/event-generator/events/syscall"

"github.com/falcosecurity/event-generator/events"
"github.com/spf13/cobra"
)

// NewList instantiates the list subcommand.
Expand Down
18 changes: 8 additions & 10 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,17 @@ import (
"strings"
"syscall"

// register event collections
_ "github.com/falcosecurity/event-generator/events/k8saudit"
_ "github.com/falcosecurity/event-generator/events/syscall"

// Initialize all k8s client auth plugins
_ "k8s.io/client-go/plugin/pkg/client/auth"

"github.com/spf13/cobra"
"github.com/spf13/pflag"

homedir "github.com/mitchellh/go-homedir"
logger "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"github.com/spf13/viper"
// Initialize all k8s client auth plugins.
_ "k8s.io/client-go/plugin/pkg/client/auth"

// register event collections.
_ "github.com/falcosecurity/event-generator/events/k8saudit"
_ "github.com/falcosecurity/event-generator/events/syscall"
)

func init() {
Expand Down
6 changes: 3 additions & 3 deletions cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ import (
"strings"
"time"

"github.com/falcosecurity/event-generator/events"
"github.com/falcosecurity/event-generator/pkg/runner"

logger "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"k8s.io/cli-runtime/pkg/genericclioptions"
cmdutil "k8s.io/kubectl/pkg/cmd/util"

"github.com/falcosecurity/event-generator/events"
"github.com/falcosecurity/event-generator/pkg/runner"
)

// DefaultNamespace const contains the name of the default Kubernetes namespace.
Expand Down
4 changes: 2 additions & 2 deletions cmd/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ package cmd
import (
"time"

"github.com/spf13/cobra"

"github.com/falcosecurity/event-generator/pkg/runner"
"github.com/falcosecurity/event-generator/pkg/tester"

"github.com/spf13/cobra"
)

// NewTest instantiates the test subcommand.
Expand Down
3 changes: 1 addition & 2 deletions events/syscall/read_ssh_information.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ limitations under the License.
package syscall

import (
"os"
"path/filepath"

"github.com/falcosecurity/event-generator/events"

"os"
)

var _ = events.Register(
Expand Down
4 changes: 2 additions & 2 deletions events/syscall/schedule_cron_jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ limitations under the License.
package syscall

import (
"github.com/falcosecurity/event-generator/events"

"os/exec"

"github.com/falcosecurity/event-generator/events"
)

var _ = events.Register(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ limitations under the License.
package syscall

import (
"github.com/falcosecurity/event-generator/events"
"golang.org/x/sys/unix"

"github.com/falcosecurity/event-generator/events"
)

var _ = events.Register(
Expand Down
3 changes: 2 additions & 1 deletion events/syscall/utils_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,9 @@ import (
"strings"
sys "syscall"

"github.com/falcosecurity/event-generator/events"
"golang.org/x/sys/unix"

"github.com/falcosecurity/event-generator/events"
)

// becameUser calls looks up the username UID then calls "setuid" syscall.
Expand Down
3 changes: 2 additions & 1 deletion pkg/counter/counter.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ import (

"github.com/falcosecurity/client-go/pkg/api/outputs"
"github.com/falcosecurity/client-go/pkg/client"
"github.com/falcosecurity/event-generator/events"
"github.com/prometheus/procfs"
logger "github.com/sirupsen/logrus"

"github.com/falcosecurity/event-generator/events"
)

type stat struct {
Expand Down
3 changes: 2 additions & 1 deletion pkg/runner/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,10 @@ import (
"strings"
"time"

"github.com/falcosecurity/event-generator/events"
logger "github.com/sirupsen/logrus"
"k8s.io/cli-runtime/pkg/resource"

"github.com/falcosecurity/event-generator/events"
)

var _ events.Helper = &helper{}
Expand Down
3 changes: 2 additions & 1 deletion pkg/runner/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ package runner
import (
"context"

"github.com/falcosecurity/event-generator/events"
logger "github.com/sirupsen/logrus"

"github.com/falcosecurity/event-generator/events"
)

type Plugin interface {
Expand Down
3 changes: 2 additions & 1 deletion pkg/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ import (
"strings"
"time"

"github.com/falcosecurity/event-generator/events"
logger "github.com/sirupsen/logrus"
cmdutil "k8s.io/kubectl/pkg/cmd/util"

"github.com/falcosecurity/event-generator/events"
)

type Runner struct {
Expand Down
3 changes: 2 additions & 1 deletion pkg/tester/tester.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ import (

"github.com/falcosecurity/client-go/pkg/api/outputs"
"github.com/falcosecurity/client-go/pkg/client"
"github.com/falcosecurity/event-generator/events"
logger "github.com/sirupsen/logrus"

"github.com/falcosecurity/event-generator/events"
)

// ErrFailed is returned when a test fails
Expand Down
2 changes: 1 addition & 1 deletion test/events/init_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ package events
import (
"testing"

evtPkg "github.com/falcosecurity/event-generator/events"
"github.com/stretchr/testify/assert"

evtPkg "github.com/falcosecurity/event-generator/events"
// Register collections and run initialization
// Duplicated name or init failure will be caught here
_ "github.com/falcosecurity/event-generator/events/k8saudit"
Expand Down
3 changes: 2 additions & 1 deletion tools/docgen/docgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ import (
"path"
"strings"

"github.com/falcosecurity/event-generator/cmd"
logger "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/cobra/doc"

"github.com/falcosecurity/event-generator/cmd"
)

const outputDir = "docs"
Expand Down

0 comments on commit 3b9644b

Please sign in to comment.