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

Instancing global configuration values #247

Open
lumapat opened this issue Mar 15, 2023 · 1 comment
Open

Instancing global configuration values #247

lumapat opened this issue Mar 15, 2023 · 1 comment

Comments

@lumapat
Copy link

lumapat commented Mar 15, 2023

I was working with gocsv to replace a CSV utility, and I noticed that configuration params were global (e.g. FailIfUnmatchedStructTags). Any reason why we shouldn’t be instancing these values with each Reader (or perhaps a separate Reader)?

Particularly for my use case, we can’t exactly enable these configurations globally since that would break more flexible instances of gocsv decoding that are live with existing external users (in production).

If there isn’t a reason, would love to contribute a new reader that takes those values instanced instead.

@shigetaichi
Copy link

@lumapat I’ve created a new package that does not use global variables, and I have used gocsv as a reference for most of the csv generation process. (Thanks to all gocsv contributors.) I hope the ideas are helpful to you.
https://github.com/shigetaichi/xsv

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

No branches or pull requests

2 participants