refactored data-types to reduce plugin sizes
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
// Copyright (c) 2024-2026 Celestino Amoroso (celestino.amoroso@gmail.com).
|
||||
// All rights reserved.
|
||||
|
||||
// cloner.go
|
||||
package kern
|
||||
|
||||
type Cloner interface {
|
||||
Clone() any
|
||||
}
|
||||
|
||||
func IsCloner(v any) (ok bool) {
|
||||
_, ok = v.(Cloner)
|
||||
return
|
||||
}
|
||||
|
||||
func Clone(a any) (clone any) {
|
||||
if IsCloner(a) {
|
||||
clone = a.(Cloner).Clone()
|
||||
} else {
|
||||
clone = a
|
||||
}
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user