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

Function NewBlock

hclwrite/ast_block.go:29–33  ·  view source on GitHub ↗

NewBlock constructs a new, empty block with the given type name and labels.

(typeName string, labels []string)

Source from the content-addressed store, hash-verified

27
28// NewBlock constructs a new, empty block with the given type name and labels.
29func NewBlock(typeName string, labels []string) *Block {
30 block := newBlock()
31 block.init(typeName, labels)
32 return block
33}
34
35func (b *Block) init(typeName string, labels []string) {
36 nameTok := newIdentToken(typeName)

Callers 1

EncodeAsBlockFunction · 0.92

Calls 2

newBlockFunction · 0.85
initMethod · 0.45

Tested by

no test coverage detected