diff --git a/plugins/diff/lcow/lcow.go b/plugins/diff/lcow/lcow.go index dec9bed12..e79d413d3 100644 --- a/plugins/diff/lcow/lcow.go +++ b/plugins/diff/lcow/lcow.go @@ -55,7 +55,7 @@ func init() { Requires: []plugin.Type{ plugins.MetadataPlugin, }, - InitFn: func(ic *plugin.InitContext) (interface{}, error) { + InitFn: func(ic *plugin.InitContext) (any, error) { md, err := ic.GetSingle(plugins.MetadataPlugin) if err != nil { return nil, err diff --git a/plugins/diff/windows/cimfs.go b/plugins/diff/windows/cimfs.go index 0db687f60..2e4926857 100644 --- a/plugins/diff/windows/cimfs.go +++ b/plugins/diff/windows/cimfs.go @@ -52,7 +52,7 @@ func init() { Requires: []plugin.Type{ plugins.MetadataPlugin, }, - InitFn: func(ic *plugin.InitContext) (interface{}, error) { + InitFn: func(ic *plugin.InitContext) (any, error) { md, err := ic.GetSingle(plugins.MetadataPlugin) if err != nil { return nil, err @@ -72,7 +72,7 @@ func init() { Requires: []plugin.Type{ plugins.MetadataPlugin, }, - InitFn: func(ic *plugin.InitContext) (interface{}, error) { + InitFn: func(ic *plugin.InitContext) (any, error) { if !cimfs.IsBlockCimSupported() { return nil, fmt.Errorf("host OS version doesn't support block CIMs: %w", plugin.ErrSkipPlugin) } diff --git a/plugins/diff/windows/windows.go b/plugins/diff/windows/windows.go index 613df25de..a884d5982 100644 --- a/plugins/diff/windows/windows.go +++ b/plugins/diff/windows/windows.go @@ -54,7 +54,7 @@ func init() { Requires: []plugin.Type{ plugins.MetadataPlugin, }, - InitFn: func(ic *plugin.InitContext) (interface{}, error) { + InitFn: func(ic *plugin.InitContext) (any, error) { md, err := ic.GetSingle(plugins.MetadataPlugin) if err != nil { return nil, err diff --git a/plugins/mount/erofs/plugin_linux.go b/plugins/mount/erofs/plugin_linux.go index fbeeef9ce..35e4b33e3 100644 --- a/plugins/mount/erofs/plugin_linux.go +++ b/plugins/mount/erofs/plugin_linux.go @@ -140,7 +140,7 @@ func init() { Type: plugins.MountHandlerPlugin, ID: "erofs", Config: &Config{}, - InitFn: func(ic *plugin.InitContext) (interface{}, error) { + InitFn: func(ic *plugin.InitContext) (any, error) { p := platforms.DefaultSpec() p.OS = runtime.GOOS ic.Meta.Platforms = append(ic.Meta.Platforms, p) diff --git a/plugins/snapshots/btrfs/plugin/plugin.go b/plugins/snapshots/btrfs/plugin/plugin.go index 324abbfdb..6c93df315 100644 --- a/plugins/snapshots/btrfs/plugin/plugin.go +++ b/plugins/snapshots/btrfs/plugin/plugin.go @@ -41,7 +41,7 @@ func init() { ID: "btrfs", Type: plugins.SnapshotPlugin, Config: &Config{}, - InitFn: func(ic *plugin.InitContext) (interface{}, error) { + InitFn: func(ic *plugin.InitContext) (any, error) { ic.Meta.Platforms = []ocispec.Platform{platforms.DefaultSpec()} config, ok := ic.Config.(*Config) diff --git a/plugins/snapshots/devmapper/metadata.go b/plugins/snapshots/devmapper/metadata.go index c4f946c99..5598a629c 100644 --- a/plugins/snapshots/devmapper/metadata.go +++ b/plugins/snapshots/devmapper/metadata.go @@ -337,7 +337,7 @@ func (m *PoolMetadata) Close() error { return nil } -func putObject(bucket *bolt.Bucket, key string, obj interface{}, overwrite bool) error { +func putObject(bucket *bolt.Bucket, key string, obj any, overwrite bool) error { keyBytes := []byte(key) if !overwrite && bucket.Get(keyBytes) != nil { @@ -356,7 +356,7 @@ func putObject(bucket *bolt.Bucket, key string, obj interface{}, overwrite bool) return nil } -func getObject(bucket *bolt.Bucket, key string, obj interface{}) error { +func getObject(bucket *bolt.Bucket, key string, obj any) error { data := bucket.Get([]byte(key)) if data == nil { return ErrNotFound diff --git a/plugins/snapshots/devmapper/plugin/plugin.go b/plugins/snapshots/devmapper/plugin/plugin.go index e3b530ae0..e54201677 100644 --- a/plugins/snapshots/devmapper/plugin/plugin.go +++ b/plugins/snapshots/devmapper/plugin/plugin.go @@ -34,7 +34,7 @@ func init() { Type: plugins.SnapshotPlugin, ID: "devmapper", Config: &devmapper.Config{}, - InitFn: func(ic *plugin.InitContext) (interface{}, error) { + InitFn: func(ic *plugin.InitContext) (any, error) { ic.Meta.Platforms = append(ic.Meta.Platforms, platforms.DefaultSpec()) config, ok := ic.Config.(*devmapper.Config) diff --git a/plugins/snapshots/lcow/lcow.go b/plugins/snapshots/lcow/lcow.go index 78d4bc498..a8fb14914 100644 --- a/plugins/snapshots/lcow/lcow.go +++ b/plugins/snapshots/lcow/lcow.go @@ -50,7 +50,7 @@ func init() { registry.Register(&plugin.Registration{ Type: plugins.SnapshotPlugin, ID: "windows-lcow", - InitFn: func(ic *plugin.InitContext) (interface{}, error) { + InitFn: func(ic *plugin.InitContext) (any, error) { ic.Meta.Platforms = append(ic.Meta.Platforms, ocispec.Platform{ OS: "linux", Architecture: runtime.GOARCH, diff --git a/plugins/snapshots/overlay/plugin/plugin.go b/plugins/snapshots/overlay/plugin/plugin.go index 69aa02a31..cd8c76120 100644 --- a/plugins/snapshots/overlay/plugin/plugin.go +++ b/plugins/snapshots/overlay/plugin/plugin.go @@ -56,7 +56,7 @@ func init() { Type: plugins.SnapshotPlugin, ID: "overlayfs", Config: &Config{}, - InitFn: func(ic *plugin.InitContext) (interface{}, error) { + InitFn: func(ic *plugin.InitContext) (any, error) { ic.Meta.Platforms = append(ic.Meta.Platforms, platforms.DefaultSpec()) config, ok := ic.Config.(*Config) diff --git a/plugins/snapshots/windows/block_cimfs.go b/plugins/snapshots/windows/block_cimfs.go index 20ace689e..dc28a398c 100644 --- a/plugins/snapshots/windows/block_cimfs.go +++ b/plugins/snapshots/windows/block_cimfs.go @@ -81,7 +81,7 @@ func init() { Type: plugins.SnapshotPlugin, ID: "blockcim", Config: &BlockCIMSnapshotterConfig{}, - InitFn: func(ic *plugin.InitContext) (interface{}, error) { + InitFn: func(ic *plugin.InitContext) (any, error) { ic.Meta.Platforms = []ocispec.Platform{platforms.DefaultSpec()} config, ok := ic.Config.(*BlockCIMSnapshotterConfig) diff --git a/plugins/snapshots/windows/cimfs.go b/plugins/snapshots/windows/cimfs.go index c338b855f..4602c7863 100644 --- a/plugins/snapshots/windows/cimfs.go +++ b/plugins/snapshots/windows/cimfs.go @@ -108,7 +108,7 @@ func init() { registry.Register(&plugin.Registration{ Type: plugins.SnapshotPlugin, ID: "cimfs", - InitFn: func(ic *plugin.InitContext) (interface{}, error) { + InitFn: func(ic *plugin.InitContext) (any, error) { ic.Meta.Platforms = []ocispec.Platform{platforms.DefaultSpec()} return NewCimFSSnapshotter(ic.Properties[plugins.PropertyRootDir]) }, diff --git a/plugins/snapshots/windows/windows.go b/plugins/snapshots/windows/windows.go index 2b3bc3484..7b497aa63 100644 --- a/plugins/snapshots/windows/windows.go +++ b/plugins/snapshots/windows/windows.go @@ -49,7 +49,7 @@ func init() { registry.Register(&plugin.Registration{ Type: plugins.SnapshotPlugin, ID: "windows", - InitFn: func(ic *plugin.InitContext) (interface{}, error) { + InitFn: func(ic *plugin.InitContext) (any, error) { ic.Meta.Platforms = []ocispec.Platform{platforms.DefaultSpec()} return NewWindowsSnapshotter(ic.Properties[plugins.PropertyRootDir]) },