Codebase list golang-github-gobuffalo-packr / 0277ceee-4e0e-42d7-b6ef-6d6903ba17cf/main v2 / file / resolver / ident.go
0277ceee-4e0e-42d7-b6ef-6d6903ba17cf/main

Tree @0277ceee-4e0e-42d7-b6ef-6d6903ba17cf/main (Download .tar.gz)

ident.go @0277ceee-4e0e-42d7-b6ef-6d6903ba17cf/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
}