rename the constructor from NewUpgrader to New

This commit is contained in:
Marten Seemann 2022-01-02 16:10:17 +04:00
parent a3f424bc1d
commit 5a79888154
2 changed files with 2 additions and 2 deletions

View File

@ -70,7 +70,7 @@ type upgrader struct {
var _ transport.Upgrader = &upgrader{} var _ transport.Upgrader = &upgrader{}
func NewUpgrader(secureMuxer sec.SecureMuxer, muxer mux.Multiplexer, opts ...Option) (transport.Upgrader, error) { func New(secureMuxer sec.SecureMuxer, muxer mux.Multiplexer, opts ...Option) (transport.Upgrader, error) {
u := &upgrader{ u := &upgrader{
secure: secureMuxer, secure: secureMuxer,
muxer: muxer, muxer: muxer,

View File

@ -32,7 +32,7 @@ func createUpgraderWithMuxer(t *testing.T, muxer mux.Multiplexer, opts ...st.Opt
require.NoError(t, err) require.NoError(t, err)
id, err := peer.IDFromPrivateKey(priv) id, err := peer.IDFromPrivateKey(priv)
require.NoError(t, err) require.NoError(t, err)
u, err := st.NewUpgrader(&MuxAdapter{tpt: insecure.NewWithIdentity(id, priv)}, muxer, opts...) u, err := st.New(&MuxAdapter{tpt: insecure.NewWithIdentity(id, priv)}, muxer, opts...)
require.NoError(t, err) require.NoError(t, err)
return id, u return id, u
} }