Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow json and yaml for file backend #25

Merged
merged 2 commits into from
Aug 21, 2021

Conversation

andrewheberle
Copy link

This PR adds a check in the file backend and performs a YAML or JSON unmarshal depending on the file extension

@abtreece abtreece self-assigned this Aug 13, 2021
@abtreece abtreece added the enhancement New feature or request label Aug 13, 2021
@abtreece
Copy link
Owner

Hey @andrewheberle

It appears that the import should be path/filepath

index 6ee8fa4..24f0620 100644
--- a/backends/file/client.go
+++ b/backends/file/client.go
@@ -2,7 +2,7 @@ package file

 import (
        "encoding/json"
-       "filepath"
+       "path/filepath"
        "fmt"
        "io/ioutil"
        "path"

Also, can you add integration tests for .json files... integration/file/test.sh

@andrewheberle
Copy link
Author

I've fixed that error and added the tests, which uncovered a problem with the original code, so there are a few more changes in backends/file/client.go

@abtreece abtreece merged commit 20e6201 into abtreece:master Aug 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants