github.com/wangyougui/gf/v2@v2.6.5/util/gutil/gutil_copy.go (about) 1 // Copyright GoFrame Author(https://goframe.org). All Rights Reserved. 2 // 3 // This Source Code Form is subject to the terms of the MIT License. 4 // If a copy of the MIT was not distributed with this file, 5 // You can obtain one at https://github.com/wangyougui/gf. 6 7 package gutil 8 9 import ( 10 "github.com/wangyougui/gf/v2/internal/deepcopy" 11 ) 12 13 // Copy returns a deep copy of v. 14 // 15 // Copy is unable to copy unexported fields in a struct (lowercase field names). 16 // Unexported fields can't be reflected by the Go runtime and therefore 17 // they can't perform any data copies. 18 func Copy(src interface{}) (dst interface{}) { 19 return deepcopy.Copy(src) 20 }