(fs billy.Filesystem, path string, v any)
| 1670 | } |
| 1671 | |
| 1672 | func 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 | |
| 1688 | const ( |
| 1689 | dockerConfigFile = dockerconfig.ConfigFileName |