Highly-opinionated (ex-bullshit-free) MTPROTO proxy for Telegram. If you use v1.0 or upgrade broke you proxy, please read the chapter Version 2
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

init_internal_test.go 573B

123456789101112131415161718192021222324
  1. package network
  2. import (
  3. "context"
  4. "github.com/9seconds/mtg/v2/essentials"
  5. "github.com/stretchr/testify/mock"
  6. )
  7. type DialerMock struct {
  8. mock.Mock
  9. }
  10. func (d *DialerMock) Dial(network, address string) (essentials.Conn, error) {
  11. args := d.Called(network, address)
  12. return args.Get(0).(essentials.Conn), args.Error(1) // nolint: wrapcheck
  13. }
  14. func (d *DialerMock) DialContext(ctx context.Context, network, address string) (essentials.Conn, error) {
  15. args := d.Called(ctx, network, address)
  16. return args.Get(0).(essentials.Conn), args.Error(1) // nolint: wrapcheck
  17. }