Skip to content

feat: move filters into a sub-package#125

Closed
Stebalien wants to merge 1 commit into
masterfrom
feat/move-filters
Closed

feat: move filters into a sub-package#125
Stebalien wants to merge 1 commit into
masterfrom
feat/move-filters

Conversation

@Stebalien

Copy link
Copy Markdown
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.
@Stebalien Stebalien force-pushed the feat/move-filters branch from 379d881 to 4449d49 Compare May 20, 2020 06:31

@raulk raulk left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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

raulk commented May 20, 2020

Copy link
Copy Markdown
Member

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

@Stebalien

Copy link
Copy Markdown
Member Author

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

@raulk

raulk commented May 20, 2020

Copy link
Copy Markdown
Member

@Stebalien Nowwwww we're talking :-)

@Stebalien

Copy link
Copy Markdown
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