plugins: modernize: any

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2026-03-17 11:50:47 +01:00
parent 73c96c54ed
commit 5ccb356620
12 changed files with 14 additions and 14 deletions

View File

@@ -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

View File

@@ -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)
}

View File

@@ -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

View File

@@ -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)

View File

@@ -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)

View File

@@ -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

View File

@@ -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)

View File

@@ -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,

View File

@@ -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)

View File

@@ -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)

View File

@@ -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])
},

View File

@@ -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])
},