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

Add ability to override where tokens are read from. #221

Merged
merged 2 commits into from
Oct 10, 2024
Merged

Conversation

kennyp
Copy link
Member

@kennyp kennyp commented Oct 3, 2024

Rationale

  • Allows for testing code that reads the token.
  • Adds missing docs.

Links

Allows for testing code that reads the token.
@kennyp kennyp assigned tt Oct 3, 2024
@kennyp kennyp requested a review from tt October 3, 2024 18:46
@mjrossi mjrossi self-requested a review October 9, 2024 14:26
// By default they are retrieved via [os.Open] and [os.ReadFile].
//
// This is useful when testing code that uses DynoID.
var DefaultFS fs.ReadFileFS = &osReader{}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would LocalFS maybe be better to match the method naming?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just following the convention from other Go packages in the stdlib. But then again they do have a set of methods that works on the default and another set that allows you to instantiate or pass in your own. 🤷

I think I'll leave it for now and we can re-visit as we play with it.

@kennyp kennyp merged commit 811b7ec into master Oct 10, 2024
3 checks passed
@kennyp kennyp deleted the kp-dynoid-test-fs branch October 10, 2024 18:08
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.

3 participants