refactored data-types to reduce plugin sizes
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
// Copyright (c) 2024-2026 Celestino Amoroso (celestino.amoroso@gmail.com).
|
||||
// All rights reserved.
|
||||
|
||||
// clone-value.go
|
||||
package types
|
||||
|
||||
// import (
|
||||
// "git.portale-stac.it/go-pkg/expr/types/array"
|
||||
// "git.portale-stac.it/go-pkg/expr/types/dict"
|
||||
// "git.portale-stac.it/go-pkg/expr/types/list"
|
||||
// )
|
||||
|
||||
// func Clone(v any) (c any) {
|
||||
// if v == nil {
|
||||
// return
|
||||
// }
|
||||
// switch unboxed := v.(type) {
|
||||
// case int64:
|
||||
// c = unboxed
|
||||
// case float64:
|
||||
// c = unboxed
|
||||
// case string:
|
||||
// c = unboxed
|
||||
// case bool:
|
||||
// c = unboxed
|
||||
// case *array.ListType:
|
||||
// c = unboxed.Clone()
|
||||
// case *dict.DictType:
|
||||
// c = unboxed.Clone()
|
||||
// case *list.LinkedList:
|
||||
// c = unboxed.Clone()
|
||||
// default:
|
||||
// c = v
|
||||
// }
|
||||
// return
|
||||
// }
|
||||
Reference in New Issue
Block a user