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

feat: rename buildRequest to BuildRequest to make it exported #394

Merged
merged 1 commit into from
Nov 10, 2024

Conversation

TimDiam0nd
Copy link
Contributor

I'm aiming to import the ftwhttp package into another Go project and call the buildRequest function directly. However, since buildRequest is unexported (lowercased), it’s inaccessible from outside the package.

Renaming buildRequest to BuildRequest would make it an exported function, allowing me to use it outside of go-ftw

@theseion
Copy link
Collaborator

Interesting! connection.Request is exported, so you could use that instead. Could you explain your use case? Maybe we can export a function that makes more sense, since buildRequest has a lot of logic.

@TimDiam0nd
Copy link
Contributor Author

I'd like to do some further logic/control on how/where the request is sent (outside Go), thus i just want the request object to then further manipulate and use.

@theseion
Copy link
Collaborator

Thanks. I'd prefer a better mechanism for exposing that functionality, e.g., a default implementation of an interface, but that would require quite a bit of work. I suppose this is good for now.

@theseion theseion merged commit 00ec2f3 into coreruleset:main Nov 10, 2024
4 checks passed
@theseion
Copy link
Collaborator

@TimDiam0nd please consider setting up commit signing. We usually require signed commits.

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