rename CopySlice to SliceCopy for package gutil

This commit is contained in:
John 2020-06-22 21:56:10 +08:00
parent aceae5eee3
commit bb07c60838
2 changed files with 2 additions and 4 deletions

2
go.mod
View File

@ -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
)

View File

@ -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