(newLabels []string)
| 122 | } |
| 123 | |
| 124 | func (bl *blockLabels) Replace(newLabels []string) { |
| 125 | bl.children.Clear() |
| 126 | bl.items.Clear() |
| 127 | |
| 128 | for _, label := range newLabels { |
| 129 | labelToks := TokensForValue(cty.StringVal(label)) |
| 130 | // Force a new label to use the quoted form, which is the idiomatic |
| 131 | // form. The unquoted form is supported in HCL 2 only for compatibility |
| 132 | // with historical use in HCL 1. |
| 133 | labelObj := newQuoted(labelToks) |
| 134 | labelNode := bl.children.Append(labelObj) |
| 135 | bl.items.Add(labelNode) |
| 136 | } |
| 137 | } |
| 138 | |
| 139 | func (bl *blockLabels) Current() []string { |
| 140 | labelNames := make([]string, 0, len(bl.items)) |
no test coverage detected