Skip to content

refactor: functional options - #3037

Open
pd93 wants to merge 2 commits into
mainfrom
refactor-functional-options
Open

pd93 wants to merge 2 commits into
mainfrom
refactor-functional-options

Conversation

@pd93

@pd93 pd93 commented Sep 16, 2026

Copy link
Copy Markdown
Member

Description

This PR contains some minor refactoring that I've pulled out of another branch to make reviewing a bit easier.

  • Return concrete struct instead of interfaces (as per Go best practice)
  • Merge NodeBase and Reader functional options for certificates
    • These are in the same package and can reuse the same functional option. The option struct simply needs to implement both interfaces. This is much easier now that the options return their raw types instead of having to create a composite interface.
  • Moves the functional options to their own file
    • This allows the Reader/BaseNode files to focus on actual functionality and not the functional options boilerplate. Since some options can be applied to more than one struct it doesn't make sense to put them in specific files.

Checklist

  • I have read and followed the Contribution Guide.
  • I have disclosed the use of any AI-generated content in this pull request per the AI Usage Policy.
  • I fully understand the changes and have hand-written the description (No AI) of this pull request.

…base and reader functional options for certificates
This allows the reader/node etc files to focus on actual functionality and not the functional options boilerplate. Since some options can be applied to more than one struct it doesn't make sense to put them in other files.
@pd93
pd93 requested review from andreynering and vmaerten and removed request for andreynering September 16, 2026 17:41
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.

1 participant