package utils import ( cortypes "gitlink.org.cn/cloudream/storage2/coordinator/types" ) func FindFeature[T cortypes.StorageFeature](detail cortypes.Storage) T { for _, f := range detail.Features { f2, ok := f.(T) if ok { return f2 } } var def T return def }