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

Method removePackage

internal/devconfig/configfile/ast.go:147–157  ·  view source on GitHub ↗

removePackage removes a package from the packages field.

(name string)

Source from the content-addressed store, hash-verified

145
146// removePackage removes a package from the packages field.
147func (c *configAST) removePackage(name string) {
148 switch val := c.packagesField(false).Value.Value.(type) {
149 case *hujson.Object:
150 c.removePackageMember(val, name)
151 case *hujson.Array:
152 c.removePackageElement(val, name)
153 default:
154 panic("packages field must be an object or array")
155 }
156 c.root.Format()
157}
158
159func (c *configAST) removePackageMember(pkgs *hujson.Object, name string) {
160 i := c.memberIndex(pkgs, name)

Callers 1

RemoveMethod · 0.80

Calls 4

packagesFieldMethod · 0.95
removePackageMemberMethod · 0.95
removePackageElementMethod · 0.95
FormatMethod · 0.45

Tested by

no test coverage detected