Fix p2p option naming to conform with the standard (#844)

This commit is contained in:
Philip Laine 2025-04-25 11:51:27 +02:00 committed by GitHub
commit 8a745a48fc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 2 deletions

View File

@ -30,6 +30,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [#824](https://github.com/spegel-org/spegel/pull/824) Fix improper image string formatting and expand tests.
- [#825](https://github.com/spegel-org/spegel/pull/825) Fix gopls modernize warnings.
- [#826](https://github.com/spegel-org/spegel/pull/826) Standardize router channel naming.
- [#844](https://github.com/spegel-org/spegel/pull/844) Fix p2p option naming to conform with the standard.
### Security

View File

@ -47,7 +47,7 @@ func (cfg *P2PRouterConfig) Apply(opts ...P2PRouterOption) error {
type P2PRouterOption func(cfg *P2PRouterConfig) error
func LibP2POptions(opts ...libp2p.Option) P2PRouterOption {
func WithLibP2POptions(opts ...libp2p.Option) P2PRouterOption {
return func(cfg *P2PRouterConfig) error {
cfg.libp2pOpts = opts
return nil

View File

@ -24,7 +24,7 @@ func TestP2PRouterOptions(t *testing.T) {
libp2p.ListenAddrStrings("foo"),
}
opts := []P2PRouterOption{
LibP2POptions(libp2pOpts...),
WithLibP2POptions(libp2pOpts...),
}
cfg := P2PRouterConfig{}
err := cfg.Apply(opts...)