MCPcopy
hub / github.com/google/go-containerregistry / Set

Method Set

cmd/crane/cmd/mutate.go:270–286  ·  view source on GitHub ↗
(val string)

Source from the content-addressed store, hash-verified

268}
269
270func (o *keyToValue) Set(val string) error {
271 before, after, ok := strings.Cut(val, "=")
272 if !ok {
273 return fmt.Errorf("%s must be formatted as key=value", val)
274 }
275
276 if !o.changed {
277 o.values = []env{}
278 o.mapped = map[string]string{}
279 }
280
281 o.values = append(o.values, env{before, after})
282 o.mapped[before] = after
283 o.changed = true
284
285 return nil
286}
287
288func (o *keyToValue) Type() string {
289 return "keyToValue"

Callers 15

handleMethod · 0.45
handleTagsMethod · 0.45
handleCatalogMethod · 0.45
handleReferrersMethod · 0.45
handleMethod · 0.45
TestCallsFunction · 0.45
v2Method · 0.45
TestCheckPushPermissionFunction · 0.45
TestRawManifestDigestsFunction · 0.45
TestPullingManifestListFunction · 0.45
fetchReferrersMethod · 0.45

Calls

no outgoing calls

Tested by 15

TestCallsFunction · 0.36
TestCheckPushPermissionFunction · 0.36
TestRawManifestDigestsFunction · 0.36
TestPullingManifestListFunction · 0.36
TestGetSchema1Function · 0.36
TestGetImageAsIndexFunction · 0.36
TestHeadSchema1Function · 0.36
TestHead_MissingHeadersFunction · 0.36