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
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

init_internal_test.go 469B

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