INNER CODE UNIT · Go
pathVars
brexhq/substation · cmd/substation/main.go:157
func pathVars(p string) (string, string) {
dir, fn := filepath.Split(p)
ext := filepath.Ext(fn)
fn = strings.TrimSuffix(fn, ext)
return dir, fn
}
// transformErrStr returns a formatted string for transform errors.
//
// If the error is not a transform error, then the error message
// is returned as is.
func transformErrStr(err error, arg string, cfg customConfig) string {
r := transformRe.FindStringSubmatch(err.Error())
// Cannot determine which transform failed. This should almost
// never happen, unless something has modified the configuration
// after it was compiled by Jsonnet.