Skip to content

Commit

Permalink
all: add windows support
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinTchokodeu committed Nov 29, 2021
1 parent ee8e327 commit abff7ba
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 9 deletions.
13 changes: 13 additions & 0 deletions internal/lock/cred_windows.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//go:build windows
// +build windows

package lock

import (
"errors"
"net"
)

func writeCredentials(c *net.UnixConn) error {
return errors.New("unimplemented")
}
5 changes: 3 additions & 2 deletions internal/lock/creds_darwin.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package lock

//go:build darwin
// +build darwin

package lock

import (
"errors"
"net"
Expand Down
5 changes: 3 additions & 2 deletions internal/lock/creds_linux.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package lock
//go:build linux
// +build linux

// +build !darwin
package lock

import (
"fmt"
Expand Down
5 changes: 3 additions & 2 deletions internal/lock/daemon_darwin.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
//go:build darwin
// +build darwin

package lock

import (
"log"
)

// +build darwin

// RunDaemon runs lock daemon
func RunDaemon() {
log.Fatal("running daemon on darwin systems are not supported.")
Expand Down
5 changes: 3 additions & 2 deletions internal/lock/daemon_linux.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package lock
//go:build linux
// +build linux

// +build !darwin
package lock

import (
"encoding/gob"
Expand Down
13 changes: 13 additions & 0 deletions internal/lock/daemon_windows.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//go:build windows
// +build windows

package lock

import (
"log"
)

// RunDaemon runs lock daemon
func RunDaemon() {
log.Fatal("running daemon on windows systems are not supported.")
}
4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,9 @@ func runBench(args []string) {
return
}

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

0 comments on commit abff7ba

Please sign in to comment.