deepcopy

package
v0.7.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2018 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

deepcopy deep copies maps, slices, etc. A standard copy will copy the pointers: deep copy copies the values pointed to.

Only what is needed has been implemented. Could make more dynamic, at the cost of reflection. Either adjust as needed or create a new function.

Copyright (c)2014, Joel Scoble (github.com/mohae), all rights reserved. License: MIT, for more details check the included LICENSE.txt.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Iface

func Iface(iface interface{}) interface{}

Iface recursively deep copies an interface{}

func InterfaceToSliceOfInts

func InterfaceToSliceOfInts(v interface{}) []int

InterfaceToSliceOfInts takes an interface that is a slice of ints and returns a deep copy of it as a slice of strings. An error is returned if the interface is not a slice of strings.

func InterfaceToSliceOfStrings

func InterfaceToSliceOfStrings(v interface{}) []string

InterfaceToSliceOfStrings takes an interface that is a slice of strings and returns a deep copy of it as a slice of strings.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL