mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
convert uses of interface{} to any
Done via:
find . -name "*.go" | xargs sed -i -E 's/interface\{\}/any/g'
PiperOrigin-RevId: 487033228
This commit is contained in:
committed by
gVisor bot
parent
c82b70015d
commit
d8aa09e04c
+1
-1
@@ -81,7 +81,7 @@ func (e *epoller) run(ctx context.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
func (e *epoller) add(id string, cgx interface{}) error {
|
||||
func (e *epoller) add(id string, cgx any) error {
|
||||
e.mu.Lock()
|
||||
defer e.mu.Unlock()
|
||||
cg, ok := cgx.(cgroups.Cgroup)
|
||||
|
||||
+1
-1
@@ -86,7 +86,7 @@ func (w *watcherV2) run(ctx context.Context) {
|
||||
}
|
||||
|
||||
// Add cgroups.Cgroup to the epoll monitor
|
||||
func (w *watcherV2) add(id string, cgx interface{}) error {
|
||||
func (w *watcherV2) add(id string, cgx any) error {
|
||||
cg, ok := cgx.(*cgroupsv2.Manager)
|
||||
if !ok {
|
||||
return fmt.Errorf("expected *cgroupsv2.Manager, got: %T", cgx)
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ import (
|
||||
// TODO(random-liu): This file can be a util.
|
||||
|
||||
var bufPool = sync.Pool{
|
||||
New: func() interface{} {
|
||||
New: func() any {
|
||||
buffer := make([]byte, 32<<10)
|
||||
return &buffer
|
||||
},
|
||||
|
||||
@@ -22,7 +22,7 @@ import (
|
||||
)
|
||||
|
||||
var bytesBufferPool = sync.Pool{
|
||||
New: func() interface{} {
|
||||
New: func() any {
|
||||
return bytes.NewBuffer(nil)
|
||||
},
|
||||
}
|
||||
|
||||
+6
-6
@@ -62,7 +62,7 @@ import (
|
||||
var (
|
||||
empty = &types.Empty{}
|
||||
bufPool = sync.Pool{
|
||||
New: func() interface{} {
|
||||
New: func() any {
|
||||
buffer := make([]byte, 32<<10)
|
||||
return &buffer
|
||||
},
|
||||
@@ -85,7 +85,7 @@ type oomPoller interface {
|
||||
io.Closer
|
||||
// add adds `cg` cgroup to oom poller. `cg` is cgroups.Cgroup in v1 and
|
||||
// `cgroupsv2.Manager` in v2
|
||||
add(id string, cg interface{}) error
|
||||
add(id string, cg any) error
|
||||
// run monitors oom event and notifies the shim about them
|
||||
run(ctx context.Context)
|
||||
}
|
||||
@@ -113,7 +113,7 @@ func New(ctx context.Context, id string, publisher shim.Publisher, cancel func()
|
||||
s := &service{
|
||||
id: id,
|
||||
processes: make(map[string]process.Process),
|
||||
events: make(chan interface{}, 128),
|
||||
events: make(chan any, 128),
|
||||
ec: proc.ExitCh,
|
||||
oomPoller: ep,
|
||||
cancel: cancel,
|
||||
@@ -160,7 +160,7 @@ type service struct {
|
||||
// processes maps ExecId to processes running through exec.
|
||||
processes map[string]process.Process
|
||||
|
||||
events chan interface{}
|
||||
events chan any
|
||||
|
||||
// platform handles operations related to the console.
|
||||
platform stdio.Platform
|
||||
@@ -502,7 +502,7 @@ func (s *service) create(ctx context.Context, r *taskAPI.CreateTaskRequest) (*ta
|
||||
pid := process.Pid()
|
||||
if pid > 0 {
|
||||
var (
|
||||
cg interface{}
|
||||
cg any
|
||||
err error
|
||||
)
|
||||
if cgroups.Mode() == cgroups.Unified {
|
||||
@@ -1041,7 +1041,7 @@ func (s *service) getProcess(execID string) (process.Process, error) {
|
||||
return p, nil
|
||||
}
|
||||
|
||||
func getTopic(e interface{}) string {
|
||||
func getTopic(e any) string {
|
||||
switch e.(type) {
|
||||
case *events.TaskCreate:
|
||||
return runtime.TaskCreateEventTopic
|
||||
|
||||
Reference in New Issue
Block a user