Skip to content

Commit 0f85f68

Browse files
committed
Use separate compilation for test transports
1 parent 5f1f359 commit 0f85f68

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

lile_unix.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,19 @@
1+
// +build !windows
2+
13
package lile
4+
5+
import (
6+
"net"
7+
)
8+
9+
func formatPlatformTestSeverAddress(uniquePortion string)(string) {
10+
return "/tmp/" + uniquePortion
11+
}
12+
13+
func getTestServerListener(address string)(net.Listener, error) {
14+
return net.Listen("unix", address)
15+
}
16+
17+
func dialTestServer(address string)(net.Conn, error) {
18+
return net.Dial("unix", address)
19+
}

lile_windows.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,20 @@
1+
// +build windows
2+
13
package lile
4+
5+
import (
6+
"github.com/natefinch/npipe"
7+
"net"
8+
)
9+
10+
func formatPlatformTestSeverAddress(uniquePortion string)(string) {
11+
return `\\.\pipe\` + uniquePortion
12+
}
13+
14+
func getTestServerListener(address string)(net.Listener, error) {
15+
return npipe.Listen(address)
16+
}
17+
18+
func dialTestServer(address string)(net.Conn, error) {
19+
return npipe.Dial(address)
20+
}

0 commit comments

Comments
 (0)