mirror of
https://gitee.com/johng/gf.git
synced 2024-12-02 12:17:53 +08:00
rename CopySlice to SliceCopy for package gutil
This commit is contained in:
parent
aceae5eee3
commit
bb07c60838
2
go.mod
2
go.mod
@ -12,9 +12,7 @@ require (
|
||||
github.com/gqcn/structs v1.1.1
|
||||
github.com/grokify/html-strip-tags-go v0.0.0-20190921062105-daaa06bf1aaf
|
||||
github.com/json-iterator/go v1.1.10
|
||||
github.com/mattn/go-runewidth v0.0.9 // indirect
|
||||
github.com/olekukonko/tablewriter v0.0.1
|
||||
golang.org/x/sys v0.0.0-20200610111108-226ff32320da // indirect
|
||||
golang.org/x/text v0.3.2
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c
|
||||
)
|
||||
|
@ -6,9 +6,9 @@
|
||||
|
||||
package gutil
|
||||
|
||||
// CopySlice does a shallow copy of slice <data> for most commonly used slice type
|
||||
// SliceCopy does a shallow copy of slice <data> for most commonly used slice type
|
||||
// []interface{}.
|
||||
func CopySlice(data []interface{}) []interface{} {
|
||||
func SliceCopy(data []interface{}) []interface{} {
|
||||
newData := make([]interface{}, len(data))
|
||||
copy(newData, data)
|
||||
return newData
|
||||
|
Loading…
Reference in New Issue
Block a user