avoid "any" as variable name

Avoid shadowing / confusion with Go's "any" built-in type.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2023-06-10 13:49:06 +02:00
parent ee2c8b79bf
commit 4bb709c018
25 changed files with 82 additions and 83 deletions

View File

@@ -142,12 +142,12 @@ func (c *criService) updateContainerResources(ctx context.Context,
// updateContainerSpec updates container spec.
func updateContainerSpec(ctx context.Context, cntr containerd.Container, spec *runtimespec.Spec) error {
any, err := typeurl.MarshalAny(spec)
s, err := typeurl.MarshalAny(spec)
if err != nil {
return fmt.Errorf("failed to marshal spec %+v: %w", spec, err)
}
if err := cntr.Update(ctx, func(ctx gocontext.Context, client *containerd.Client, c *containers.Container) error {
c.Spec = any
c.Spec = s
return nil
}); err != nil {
return fmt.Errorf("failed to update container spec: %w", err)