Tips on how to Carry out a Deep Copy in Golang

To carry out a Deep Copy in Go, you should utilize a struct kind as follows:

Deep Copying utilizing a struct in Go#

package deal predominant

import (

kind Canine struct {
    age     int
    title    string
    associates []string

func predominant() {
    john := Canine{1, "Harry", []string{"Steve", "Matt", "Sarah"}}
    jack := john = make([]string, len(
    copy(, = append(, "Fred")