Windows fixes

This commit is contained in:
AlexSSD7 2023-09-03 14:08:24 +01:00
commit 1b69e6294d
7 changed files with 30 additions and 20 deletions

View file

@ -28,11 +28,12 @@ import (
"strings"
"time"
"log/slog"
"github.com/AlexSSD7/linsk/utils"
"github.com/alessio/shellescape"
"github.com/google/uuid"
"github.com/pkg/errors"
"golang.org/x/exp/slog"
)
func Available() bool {
@ -66,7 +67,8 @@ func NewTapManager(logger *slog.Logger) (*TapManager, error) {
var tapNameRegexp = regexp.MustCompile(`^LinskTap-\d+$`)
func NewUniqueTapName() (string, error) {
return fmt.Sprintf("LinskTap-%v", time.Now().UnixNano())
time.Sleep(time.Millisecond)
return fmt.Sprintf("LinskTap-%v", time.Now().UnixNano()), nil
}
func (tm *TapManager) CreateNewTap(tapName string) error {