func readJsonc[a any]()

in custard/pkg/config/utils.go [29:40]


func readJsonc[a any](path string, ref *a) error {
	// Read the JSONC file.
	sourceJsonc, err := os.ReadFile(path)
	if err != nil {
		return err
	}

	// Strip the comments and load the JSON.
	sourceJson := multiLine.ReplaceAll(sourceJsonc, []byte{})
	sourceJson = singleLine.ReplaceAll(sourceJson, []byte{})
	return json.Unmarshal(sourceJson, ref)
}