MCPcopy Index your code
hub / github.com/coderanger/migrations-operator / deepCopyJSON

Function deepCopyJSON

components/migrations.go:86–102  ·  view source on GitHub ↗
(src map[string]interface{}, dest map[string]interface{})

Source from the content-addressed store, hash-verified

84}
85
86func deepCopyJSON(src map[string]interface{}, dest map[string]interface{}) error {
87 if src == nil {
88 return errors.New("src is nil. You cannot read from a nil map")
89 }
90 if dest == nil {
91 return errors.New("dest is nil. You cannot insert to a nil map")
92 }
93 jsonStr, err := json.Marshal(src)
94 if err != nil {
95 return err
96 }
97 err = json.Unmarshal(jsonStr, &dest)
98 if err != nil {
99 return err
100 }
101 return nil
102}
103
104func (comp *migrationsComponent) Reconcile(ctx *cu.Context) (cu.Result, error) {
105 obj := ctx.Object.(*migrationsv1beta1.Migrator)

Callers 1

ReconcileMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected