Add comment to explain dropping the opening json object delimiter.

reviewable/pr2557/r8
Justin Scott 8 years ago
parent 915da4655d
commit 92d3dd52c2

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

Loading…
Cancel
Save