Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

Commit

Permalink
fix: pass pointers to maps to yaml.Unmarshal
Browse files Browse the repository at this point in the history
  • Loading branch information
eliobischof committed Dec 9, 2019
1 parent 6277d7e commit 27dec7e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/core/operator/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func (i *Iterator) iterate(stop <-chan struct{}) *IterationDone {
return &IterationDone{Error: err}
}

if err := yaml.Unmarshal(secretsBytes, i.secrets); err != nil {
if err := yaml.Unmarshal(secretsBytes, &i.secrets); err != nil {
return &IterationDone{Error: err}
}

Expand Down Expand Up @@ -134,11 +134,11 @@ func (i *Iterator) iterate(stop <-chan struct{}) *IterationDone {
current map[string]interface{}
)

if err := yaml.Unmarshal(desiredBytes, desired); err != nil {
if err := yaml.Unmarshal(desiredBytes, &desired); err != nil {
return &IterationDone{Error: err}
}

if err := yaml.Unmarshal(currentBytes, current); err != nil {
if err := yaml.Unmarshal(currentBytes, &current); err != nil {
return &IterationDone{Error: err}
}

Expand Down Expand Up @@ -168,7 +168,7 @@ func (i *Iterator) iterate(stop <-chan struct{}) *IterationDone {
&git.File{Path: i.args.CurrentFile, Overwrite: func(reloadedCurrent []byte) ([]byte, error) {

var reloadedCurrentMap map[string]interface{}
if err := yaml.Unmarshal(currentBytes, current); err != nil {
if err := yaml.Unmarshal(reloadedCurrent, &reloadedCurrentMap); err != nil {
return nil, err
}

Expand Down

0 comments on commit 27dec7e

Please sign in to comment.