Skip to content

Commit

Permalink
fastip: fix helper upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
EugeneOne1 committed Apr 11, 2023
1 parent 15e8329 commit b5ed387
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions fastip/fastest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,24 @@ func TestFastestAddr_ExchangeFastest(t *testing.T) {
}

type errUpstream struct {
upstream.Upstream
err error
err error
closeErr error
}

func (u errUpstream) Exchange(_ *dns.Msg) (*dns.Msg, error) {
// Address implements the [upstream.Upstream] interface for errUpstream.
func (u *errUpstream) Address() string {
return "bad_upstream"
}

// Exchange implements the [upstream.Upstream] interface for errUpstream.
func (u *errUpstream) Exchange(_ *dns.Msg) (*dns.Msg, error) {
return nil, u.err
}

func (u *errUpstream) Close() error {
return u.closeErr
}

type testAUpstream struct {
recs []*dns.A
}
Expand Down

0 comments on commit b5ed387

Please sign in to comment.