Skip to content

Commit

Permalink
chore: remove golang.org/x/slices
Browse files Browse the repository at this point in the history
  • Loading branch information
pgimalac committed Dec 23, 2024
1 parent e6c945e commit 7cf596d
Show file tree
Hide file tree
Showing 18 changed files with 17 additions and 25 deletions.
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -605,6 +605,8 @@ linters-settings:
desc: "Not really forbidden to use, but it is usually imported by mistake instead of github.com/stretchr/testify/assert, and confusing since it actually has the behavior of github.com/stretchr/testify/require"
- pkg: "debug/elf"
desc: "prefer pkg/util/safeelf to prevent panics during parsing"
- pkg: "golang.org/x/exp/slices"
desc: "use the std slices package instead"
logger:
files:
- "!**/pkg/util/log/**"
Expand Down
1 change: 0 additions & 1 deletion comp/core/log/mock/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ require (
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
go.uber.org/atomic v1.11.0 // indirect
golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/text v0.21.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
Expand Down
1 change: 0 additions & 1 deletion pkg/config/env/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ require (
github.com/spf13/pflag v1.0.5 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
go.uber.org/atomic v1.11.0 // indirect
golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/text v0.21.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
Expand Down
2 changes: 0 additions & 2 deletions pkg/config/env/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/config/model/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ require (
github.com/DataDog/viper v1.14.0
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826
github.com/stretchr/testify v1.10.0
golang.org/x/exp v0.0.0-20241210194714-1829a127f884
)

require (
Expand All @@ -23,6 +22,7 @@ require (
github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/fsnotify/fsnotify v1.8.0 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/hashicorp/hcl v1.0.1-vault-5 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect
Expand Down
2 changes: 0 additions & 2 deletions pkg/config/model/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions pkg/config/model/viper.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,16 @@ import (
"io"
"os"
"path"
"path/filepath"
"reflect"
"slices"
"strconv"
"strings"
"sync"
"time"

"path/filepath"

"github.com/DataDog/viper"
"github.com/mohae/deepcopy"
"golang.org/x/exp/slices"

"github.com/DataDog/datadog-agent/pkg/util/log"
)
Expand Down
5 changes: 2 additions & 3 deletions pkg/config/nodetreemodel/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,14 @@ import (
"fmt"
"io"
"os"
"path/filepath"
"reflect"
"slices"
"strings"
"sync"

"path/filepath"

"github.com/DataDog/viper"
"go.uber.org/atomic"
"golang.org/x/exp/slices"

"github.com/DataDog/datadog-agent/pkg/config/model"
"github.com/DataDog/datadog-agent/pkg/util/log"
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/nodetreemodel/getter.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ package nodetreemodel

import (
"maps"
"slices"
"time"

"github.com/DataDog/datadog-agent/pkg/config/model"
"github.com/DataDog/datadog-agent/pkg/util/log"
"github.com/mohae/deepcopy"
"github.com/spf13/cast"
"golang.org/x/exp/slices"
)

func (c *ntmConfig) leafAtPath(key string) LeafNode {
Expand Down
1 change: 0 additions & 1 deletion pkg/config/teeconfig/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ require (
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
go.uber.org/atomic v1.11.0 // indirect
golang.org/x/exp v0.0.0-20241210194714-1829a127f884 // indirect
golang.org/x/sys v0.28.0 // indirect
golang.org/x/text v0.21.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
Expand Down
2 changes: 0 additions & 2 deletions pkg/config/teeconfig/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion pkg/security/process_list/activity_tree/activity_tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
package activitytree

import (
"slices"

"github.com/DataDog/datadog-go/v5/statsd"
"golang.org/x/exp/slices"

processlist "github.com/DataDog/datadog-agent/pkg/security/process_list"
processresolver "github.com/DataDog/datadog-agent/pkg/security/process_list/process_resolver"
Expand Down
2 changes: 1 addition & 1 deletion pkg/security/process_list/process_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ import (
"errors"
"fmt"
"io"
"slices"
"sync"

"github.com/DataDog/datadog-agent/pkg/process/procutil"
cgroupModel "github.com/DataDog/datadog-agent/pkg/security/resolvers/cgroup/model"
"github.com/DataDog/datadog-agent/pkg/security/secl/model"
"github.com/DataDog/datadog-go/v5/statsd"
"golang.org/x/exp/slices"
"golang.org/x/sys/unix"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/security/process_list/process_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import (
"fmt"
"io"
"math/rand"
"slices"
"sync"

"github.com/DataDog/datadog-agent/pkg/security/secl/model"
"golang.org/x/exp/slices"
)

// ProcessNode holds the activity of a process
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
package processresolver

import (
"slices"
"testing"
"time"

processlist "github.com/DataDog/datadog-agent/pkg/security/process_list"
cgroupModel "github.com/DataDog/datadog-agent/pkg/security/resolvers/cgroup/model"
"github.com/DataDog/datadog-agent/pkg/security/secl/model"
"github.com/stretchr/testify/assert"
"golang.org/x/exp/slices"
)

func newFakeExecEvent(ppid, pid int, pathname string) *model.Event {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ package activitytree
import (
"fmt"
"io"
"slices"
"sort"
"strings"

"github.com/DataDog/datadog-agent/pkg/security/resolvers"
sprocess "github.com/DataDog/datadog-agent/pkg/security/resolvers/process"
"github.com/DataDog/datadog-agent/pkg/security/secl/model"
"github.com/DataDog/datadog-agent/pkg/security/utils"
"golang.org/x/exp/slices"
)

// ProcessNodeParent is an interface used to identify the parent of a process node
Expand Down
3 changes: 2 additions & 1 deletion pkg/security/security_profile/activity_tree/socket_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
package activitytree

import (
"slices"

"github.com/DataDog/datadog-agent/pkg/security/secl/model"
"golang.org/x/exp/slices"
)

// BindNode is used to store a bind node
Expand Down
3 changes: 1 addition & 2 deletions pkg/util/port/portlist/poller.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ package portlist

import (
"fmt"
"slices"
"sort"
"sync"

"golang.org/x/exp/slices"
)

// Poller scans the systems for listening ports periodically and sends
Expand Down

0 comments on commit 7cf596d

Please sign in to comment.