Codebase list golang-github-gobuffalo-packr / fc3fc6f9-6e6f-4e48-859d-fced44c8ecbb/main v2 / file / resolver / ident.go
fc3fc6f9-6e6f-4e48-859d-fced44c8ecbb/main

Tree @fc3fc6f9-6e6f-4e48-859d-fced44c8ecbb/main (Download .tar.gz)

ident.go @fc3fc6f9-6e6f-4e48-859d-fced44c8ecbb/mainraw · history · blame

package resolver

import (
	"path/filepath"
	"runtime"
	"strings"
)

func Key(s string) string {
	s = strings.Replace(s, "\\", "/", -1)
	return s
}

func OsPath(s string) string {
	if runtime.GOOS == "windows" {
		s = strings.Replace(s, "/", string(filepath.Separator), -1)
	} else {
		s = strings.Replace(s, "\\", string(filepath.Separator), -1)
	}
	return s
}