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

Method AppendNewBlock

hclwrite/ast_body.go:240–245  ·  view source on GitHub ↗

AppendNewBlock appends a new nested block to the end of the receiving body with the given type name and labels.

(typeName string, labels []string)

Source from the content-addressed store, hash-verified

238// AppendNewBlock appends a new nested block to the end of the receiving body
239// with the given type name and labels.
240func (b *Body) AppendNewBlock(typeName string, labels []string) *Block {
241 block := newBlock()
242 block.init(typeName, labels)
243 b.appendItem(block)
244 return block
245}
246
247// AppendNewline appends a newline token to th end of the receiving body,
248// which generally serves as a separator between different sets of body

Callers 2

TestBodyAppendBlockFunction · 0.80

Implementers 8

Bodyhclsyntax/structure.go
unknownBodyext/dynblock/unknown_body.go
expandBodyext/dynblock/expand_body.go
deepWrapperext/transform/transform.go
diagBodyext/transform/error.go
bodyjson/structure.go
mockBodyhcltest/mock.go

Calls 3

appendItemMethod · 0.95
newBlockFunction · 0.85
initMethod · 0.45

Tested by 2

TestBodyAppendBlockFunction · 0.64