code: func (o *outputBuilder) renderWithTextProto(includePBHeader bool) (map[string][]byte, error) {
  	out := make(map[string][]byte, o.Len())
  
  	for _, kv := range o.Items() {
  		k, v := kv[0].(starlark.String), kv[1]
  
  		if s, ok := v.(starlark.String); ok {
  			out[k.GoString()] = []byte(s.GoString())
  			continue
  		}
  
  		msg, err := v.(*starlarkproto.Message).ToProto()
  		if err != nil {
  			return nil, err
  		}
  
  		buf := bytes.Buffer{}
  		if includePBHeader {
  			buf.WriteString("# Auto-generated by lucicfg.\n")
  			buf.WriteString("# Do not modify manually.\n")
  			if msgName, docURL := protoMessageDoc(msg); docURL != "" {
  				buf.WriteString("#\n")
  				fmt.Fprintf(&buf, "# For the schema of this file, see %s message:\n", msgName)
  				fmt.Fprintf(&buf, "#   %s\n", docURL)
  			}
  			buf.WriteString("\n")
  		}
  		proto.MarshalText(&buf, msg)
  
  		out[k.GoString()] = buf.Bytes()
  	}
  
  	return out, nil
  }
docs: // renderWithTextProto returns output files with all protos serialized to text
  // proto format (optionally with the header that tells how the file was
  // generated).
  //
  // Configs supplied as strings are serialized using UTF-8 encoding.