Add comment to explain dropping the opening json object delimiter.

reviewable/pr2557/r10
Justin Scott 8 years ago
parent 355942f4fb
commit e7e9ea0229

@ -206,6 +206,7 @@ func (i *initCmd) run() error {
const tm = `{"apiVersion":"extensions/v1beta1","kind":"Deployment",` const tm = `{"apiVersion":"extensions/v1beta1","kind":"Deployment",`
buf := bytes.NewBuffer(make([]byte, 0, len(tm)+len(jsonb)-1)) buf := bytes.NewBuffer(make([]byte, 0, len(tm)+len(jsonb)-1))
buf.WriteString(tm) buf.WriteString(tm)
// Drop the opening object delimiter ('{').
buf.Write(jsonb[1:]) buf.Write(jsonb[1:])
if err := json.Indent(&out, buf.Bytes(), "", " "); err != nil { if err := json.Indent(&out, buf.Bytes(), "", " "); err != nil {
return err return err

Loading…
Cancel
Save