package dav import ( "fmt" "path/filepath" ) // optimized versions, no more marshalling func BaseDirectory(path, added string) string { return fmt.Sprintf("/%s%sHTTP/1.1 200 OK", customPathEscape(path), added) } func Directory(path, added string) string { path = filepath.Base(path) return fmt.Sprintf("%s%sHTTP/1.1 200 OK", customPathEscape(path), added) } func File(path string, fileSize int64, added string) string { path = filepath.Base(path) return fmt.Sprintf("%s%d%sHTTP/1.1 200 OK", customPathEscape(path), fileSize, added) }