mirror of
https://github.com/containers/podman.git
synced 2025-10-20 12:43:58 +08:00

Use filepath utility instead of generic string replace to convert path on Windows. This also separates OS specific implementations to separate compilation sources and removes redundant check for virtualization provider on Windows platform. Signed-off-by: Arthur Sengileyev <arthur.sengileyev@gmail.com>
16 lines
354 B
Go
16 lines
354 B
Go
package main
|
|
|
|
import (
|
|
"errors"
|
|
"path/filepath"
|
|
|
|
"github.com/containers/podman/v5/pkg/machine/define"
|
|
)
|
|
|
|
func extractConnectionString(podmanSocket *define.VMFile, podmanPipe *define.VMFile) (string, error) {
|
|
if podmanPipe == nil {
|
|
return "", errors.New("pipe of machine is not set")
|
|
}
|
|
return "npipe://" + filepath.ToSlash(podmanPipe.Path), nil
|
|
}
|