Skip to content

Ability to use multiple provider files.#50

Open
pczajkowski wants to merge 4 commits intoproabiral:masterfrom
pczajkowski:master
Open

Ability to use multiple provider files.#50
pczajkowski wants to merge 4 commits intoproabiral:masterfrom
pczajkowski:master

Conversation

@pczajkowski
Copy link
Contributor

This is interesting request (#34), so I've went ahead and implemented it. The only sensible way to do it IMHO is by utilizing flag.Args() and because of that the program should be called with -provider parameter and additional provider JSONs at the end, like./inception -d list -provider provider.json provider2.json provider3.json provider4.json.

I also believe that with multiple files it's better to not crash on read/unmarshalling failure, so I've modified errCheckJSON and added errCheckInfo, so that os.Exit(1) won't be called. But I'm not insisting I'm right here.

It's quite a change and I'm not 100% satisfied with this solution, but at this point I don't see other option.

@pczajkowski
Copy link
Contributor Author

pczajkowski commented Jul 13, 2020

The other option I see would be to pass delimited list of files to -provider, like -provider "provider.json,provider2.json,provider3.json,provider4.json. And then process it using strings.Split. But it's ugly and less user-friendly, I believe.

@proabiral
Copy link
Owner

Hi @pczajkowski ,
Thank you so much for the pull request. I think we should go with first option. I will review and merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants