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

Method RootName

traversal.go:154–160  ·  view source on GitHub ↗

RootName returns the root name for a absolute traversal. Will panic if called on a relative traversal.

()

Source from the content-addressed store, hash-verified

152// RootName returns the root name for a absolute traversal. Will panic if
153// called on a relative traversal.
154func (t Traversal) RootName() string {
155 if t.IsRelative() {
156 panic("can't use RootName on a relative traversal")
157
158 }
159 return t[0].(TraverseRoot).Name
160}
161
162// SourceRange returns the source range for the traversal.
163func (t Traversal) SourceRange() Range {

Callers 10

ExprAsKeywordFunction · 0.45
RootNameMethod · 0.45
EnterMethod · 0.45
TestVariablesFunction · 0.45
VariablesMethod · 0.45
VisitMethod · 0.45
decodeSpecMethod · 0.45
TestTerraformLikeFunction · 0.45

Calls 1

IsRelativeMethod · 0.95

Tested by 3

TestVariablesFunction · 0.36
TestTerraformLikeFunction · 0.36