37 lines
733 B
Go
37 lines
733 B
Go
// 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
|
|
// }
|