package vm type Function struct { Instructions []*Instruction } func (fnc *Function) Copy() *Function { ret := &Function{} for _, instr := range fnc.Instructions { ret.Instructions = append(ret.Instructions, instr.Copy()) } return ret }