Skip to content

all: add windows support #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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