MCPcopy Create free account
hub / github.com/coder/envbuilder / parseMagicImageFile

Function parseMagicImageFile

envbuilder.go:1672–1686  ·  view source on GitHub ↗
(fs billy.Filesystem, path string, v any)

Source from the content-addressed store, hash-verified

1670}
1671
1672func parseMagicImageFile(fs billy.Filesystem, path string, v any) error {
1673 file, err := fs.Open(path)
1674 if err != nil {
1675 return fmt.Errorf("open magic image file: %w", err)
1676 }
1677 defer file.Close()
1678
1679 dec := json.NewDecoder(file)
1680 dec.DisallowUnknownFields()
1681 if err := dec.Decode(v); err != nil {
1682 return fmt.Errorf("decode magic image file: %w", err)
1683 }
1684
1685 return nil
1686}
1687
1688const (
1689 dockerConfigFile = dockerconfig.ConfigFileName

Callers 1

runFunction · 0.85

Calls 1

CloseMethod · 0.80

Tested by

no test coverage detected