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: move filters into a sub-package #125

Closed
wants to merge 1 commit into from
Closed

Conversation

Stebalien
Copy link
Member

These really don't belong in the root package.

@Stebalien Stebalien requested a review from raulk May 20, 2020 06:23
@Stebalien Stebalien force-pushed the feat/move-filters branch 3 times, most recently from 90288d8 to 379d881 Compare May 20, 2020 06:26
These really don't belong in the root package.
Copy link
Member

@raulk raulk left a comment

Choose a reason for hiding this comment

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

A package containing a single component introduces complexity for no reason. In idiomatic Go, filters.Filter is also a smell that the package shouldn’t exist.

@Stebalien
Copy link
Member Author

I agree that single-type packages are suboptimal, but it doesn't belong in the root package. A multiaddr set might belong in the root package, but this filter type is highly specialized (special IPNet functions, filter actions, etc.). Remember, this package has implementations in many languages and needs to present a cohesive minimal interface.

How about a compromise:

  1. Move go-multiaddr-net into go-multiaddr/net.
  2. Move this filter package into go-multiaddr/net.

@raulk
Copy link
Member

raulk commented May 20, 2020

@Stebalien Deal taken! That simplifies our codebase even further. Is this something you plan on tackling?

@Stebalien
Copy link
Member Author

Yeah. It's been annoying me for a while... I wonder if I can fold go-multiaddr-dns into the deal.

@raulk
Copy link
Member

raulk commented May 20, 2020

@Stebalien Nowwwww we're talking :-)

@Stebalien
Copy link
Member Author

Replaced with #127.

@Stebalien Stebalien closed this May 20, 2020
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