Skip to content

Commit 64043ee

Browse files
all: add windows support (#3)
Updates #2
1 parent ee8e327 commit 64043ee

File tree

7 files changed

+41
-9
lines changed

7 files changed

+41
-9
lines changed

internal/lock/cred_windows.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//go:build windows
2+
// +build windows
3+
4+
package lock
5+
6+
import (
7+
"errors"
8+
"net"
9+
)
10+
11+
func writeCredentials(c *net.UnixConn) error {
12+
return errors.New("unimplemented")
13+
}

internal/lock/creds_darwin.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
1-
package lock
2-
1+
//go:build darwin
32
// +build darwin
43

4+
package lock
5+
56
import (
67
"errors"
78
"net"

internal/lock/creds_linux.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
package lock
1+
//go:build linux
2+
// +build linux
23

3-
// +build !darwin
4+
package lock
45

56
import (
67
"fmt"

internal/lock/daemon_darwin.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1+
//go:build darwin
2+
// +build darwin
3+
14
package lock
25

36
import (
47
"log"
58
)
69

7-
// +build darwin
8-
910
// RunDaemon runs lock daemon
1011
func RunDaemon() {
1112
log.Fatal("running daemon on darwin systems are not supported.")

internal/lock/daemon_linux.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
package lock
1+
//go:build linux
2+
// +build linux
23

3-
// +build !darwin
4+
package lock
45

56
import (
67
"encoding/gob"

internal/lock/daemon_windows.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//go:build windows
2+
// +build windows
3+
4+
package lock
5+
6+
import (
7+
"log"
8+
)
9+
10+
// RunDaemon runs lock daemon
11+
func RunDaemon() {
12+
log.Fatal("running daemon on windows systems are not supported.")
13+
}

main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,9 @@ func runBench(args []string) {
329329
return
330330
}
331331

332-
fname := "bench-" + time.Now().Format("2006-01-02-15:04:05") + ".txt"
332+
// Note that we should avoid using : in filename, because it is not
333+
// supported on Windows file systems.
334+
fname := "bench-" + time.Now().Format("2006-01-02-15-04-05") + ".txt"
333335
err = ioutil.WriteFile(fname, results, 0644)
334336
if err != nil {
335337
// try again, maybe the user was too fast?

0 commit comments

Comments
 (0)