Codebase list golang-github-gobuffalo-packr / d9a7b2bc-360e-461f-9119-b2d48c5d4a9c/upstream v2 / file / resolver / ident.go
d9a7b2bc-360e-461f-9119-b2d48c5d4a9c/upstream

Tree @d9a7b2bc-360e-461f-9119-b2d48c5d4a9c/upstream (Download .tar.gz)

ident.go @d9a7b2bc-360e-461f-9119-b2d48c5d4a9c/upstreamraw · 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
}