MCPcopy Index your code
hub / github.com/jetify-com/devbox / appendPackageToArray

Method appendPackageToArray

internal/devconfig/configfile/ast.go:133–144  ·  view source on GitHub ↗
(arr *hujson.Array, versionedName string)

Source from the content-addressed store, hash-verified

131}
132
133func (c *configAST) appendPackageToArray(arr *hujson.Array, versionedName string) {
134 var extra []byte
135 if len(arr.Elements) > 0 {
136 // Put each element on its own line if there
137 // will be more than 1.
138 extra = []byte{'\n'}
139 }
140 arr.Elements = append(arr.Elements, hujson.Value{
141 BeforeExtra: extra,
142 Value: hujson.String(versionedName),
143 })
144}
145
146// removePackage removes a package from the packages field.
147func (c *configAST) removePackage(name string) {

Callers 1

appendPackageMethod · 0.95

Calls 1

StringMethod · 0.45

Tested by

no test coverage detected