MCPcopy
hub / github.com/hashicorp/hcl / Bytes

Method Bytes

hclwrite/ast.go:48–53  ·  view source on GitHub ↗

Bytes returns a buffer containing the source code resulting from the tokens underlying the receiving file. If any updates have been made via the AST API, these will be reflected in the result.

()

Source from the content-addressed store, hash-verified

46// tokens underlying the receiving file. If any updates have been made via
47// the AST API, these will be reflected in the result.
48func (f *File) Bytes() []byte {
49 buf := &bytes.Buffer{}
50 //nolint:errcheck // FIXME: Propogate errors upward.
51 f.WriteTo(buf)
52 return buf.Bytes()
53}
54
55type comments struct {
56 leafNode

Callers 13

ExampleEncodeIntoBodyFunction · 0.45
TestFormatFunction · 0.45
TestBodySetAttributeRawFunction · 0.45
TestBodyRemoveBlockFunction · 0.45
TestRoundTripVerbatimFunction · 0.45
FormatFunction · 0.45
hcldecTransformMethod · 0.45

Calls 1

WriteToMethod · 0.95

Tested by 10

ExampleEncodeIntoBodyFunction · 0.36
TestFormatFunction · 0.36
TestBodySetAttributeRawFunction · 0.36
TestBodyRemoveBlockFunction · 0.36
TestRoundTripVerbatimFunction · 0.36