mirror of
https://github.com/stashapp/stash.git
synced 2025-12-19 14:53:01 +01:00
21 lines
368 B
Go
21 lines
368 B
Go
package name
|
|
|
|
import (
|
|
"path/filepath"
|
|
"runtime"
|
|
"strings"
|
|
)
|
|
|
|
func OsPath(s string) string {
|
|
return New(s).OsPath().String()
|
|
}
|
|
|
|
func (i Ident) OsPath() Ident {
|
|
s := i.String()
|
|
if runtime.GOOS == "windows" {
|
|
s = strings.Replace(s, "/", string(filepath.Separator), -1)
|
|
} else {
|
|
s = strings.Replace(s, "\\", string(filepath.Separator), -1)
|
|
}
|
|
return New(s)
|
|
}
|