(filepath string)
| 82 | } |
| 83 | |
| 84 | func readFile(filepath string) (any, error) { |
| 85 | f, err := os.Open(filepath) |
| 86 | if err != nil { |
| 87 | return nil, fmt.Errorf("failed to open file: %w", err) |
| 88 | } |
| 89 | defer f.Close() |
| 90 | |
| 91 | b, err := io.ReadAll(f) |
| 92 | if err != nil { |
| 93 | return nil, fmt.Errorf("failed to read file: %w", err) |
| 94 | } |
| 95 | |
| 96 | var v any |
| 97 | if err := toml.Unmarshal(b, &v); err != nil { |
| 98 | return nil, fmt.Errorf("failed to unmarshal toml: %w", err) |
| 99 | } |
| 100 | |
| 101 | return v, nil |
| 102 | } |
| 103 | |
| 104 | func GenerateJSONPatch(origfilepath, newfilepath, dst string) error { |
| 105 | origo, err := readFile(origfilepath) |
no test coverage detected