@@ -98,10 +98,11 @@ type authorityTest struct {
98
98
99
99
var authorityTests = []authorityTest {
100
100
{
101
- name : "UnixRelative" ,
102
- address : "sock.sock" ,
103
- target : "unix:sock.sock" ,
104
- authority : "localhost" ,
101
+ name : "UnixRelative" ,
102
+ address : "sock.sock" ,
103
+ target : "unix:sock.sock" ,
104
+ authority : "localhost" ,
105
+ dialTargetWant : "unix:sock.sock" ,
105
106
},
106
107
{
107
108
name : "UnixAbsolute" ,
@@ -111,10 +112,11 @@ var authorityTests = []authorityTest{
111
112
dialTargetWant : "unix:///tmp/sock.sock" ,
112
113
},
113
114
{
114
- name : "UnixAbsoluteAlternate" ,
115
- address : "/tmp/sock.sock" ,
116
- target : "unix:///tmp/sock.sock" ,
117
- authority : "localhost" ,
115
+ name : "UnixAbsoluteAlternate" ,
116
+ address : "/tmp/sock.sock" ,
117
+ target : "unix:///tmp/sock.sock" ,
118
+ authority : "localhost" ,
119
+ dialTargetWant : "unix:///tmp/sock.sock" ,
118
120
},
119
121
{
120
122
name : "UnixPassthrough" ,
@@ -148,9 +150,6 @@ func (s) TestUnix(t *testing.T) {
148
150
func (s ) TestUnixCustomDialer (t * testing.T ) {
149
151
for _ , test := range authorityTests {
150
152
t .Run (test .name + "WithDialer" , func (t * testing.T ) {
151
- if test .dialTargetWant == "" {
152
- test .dialTargetWant = test .target
153
- }
154
153
dialer := func (ctx context.Context , address string ) (net.Conn , error ) {
155
154
if address != test .dialTargetWant {
156
155
return nil , fmt .Errorf ("expected target %v in custom dialer, instead got %v" , test .dialTargetWant , address )
0 commit comments