Skip to content

Instantly share code, notes, and snippets.

View jacexh's full-sized avatar
💭
I may be slow to respond.

jacexh

💭
I may be slow to respond.
  • Suzhou, China
  • 02:11 (UTC +08:00)
View GitHub Profile
@jacexh
jacexh / deepcopy.go
Created July 1, 2022 03:15 — forked from soroushjp/deepcopy.go
Golang: deepcopy map[string]interface{}. Could be used for any other Go type with minor modifications.
// Package deepcopy provides a function for deep copying map[string]interface{}
// values. Inspired by the StackOverflow answer at:
// http://stackoverflow.com/a/28579297/1366283
//
// Uses the golang.org/pkg/encoding/gob package to do this and therefore has the
// same caveats.
// See: https://blog.golang.org/gobs-of-data
// See: https://golang.org/pkg/encoding/gob/
package deepcopy