Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseMultilineStrings ¶
ParseMultilineStrings looks for bash-style heredocs and replaces them with single-line text-proto-escaped strings.
This looks line by line for /<<\s*([_a-zA-Z]+)\s*$/. If this is found, the scanner then looks until it finds /^\s*\1\s*$/. Every line between these is joined like "\n".join(lines), and then printed back as an escaped proto string. The scanner then loops back to its initial state.
Not that nothing special needs to be done for e.g.
some_key: "string with << angles"
Such a line would be left alone, because the trailing quote (which is mandatory in text proto) cause the starting regex to not match.
For convenience, the inner lines will be treated with the equivalent of python's `textwrap.dedent`; any common leading whitespace that occurs on every line will be removed. Although both tabs and spaces count as whitespace, they are not equivalent (i.e. only exactly-matching whitespace prefixes count)
The only error this may return is if there's an open heredoc without a matching close marker.
Example:
this: <<EOF would turn \ninto a "single" line EOF
Turns into the same as:
this: "would\nturn \\ninto\n a \"single\"\nline"
Types ¶
This section is empty.
Directories ¶
Path | Synopsis |
---|---|
Package config contains luci-config protobuf definitions.
|
Package config contains luci-config protobuf definitions. |
Package google contains utility methods to help interface between Google standard protobufs and native Go types.
|
Package google contains utility methods to help interface between Google standard protobufs and native Go types. |
descutil
Package descutil contains utility functions for protobuf descriptor messages.
|
Package descutil contains utility functions for protobuf descriptor messages. |
Package milo is a generated protocol buffer package.
|
Package milo is a generated protocol buffer package. |