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
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

init_internal_test.go 607B

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, forcetypeassert
  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, forcetypeassert
  17. }