refactor list into ReadDir and use os.FileInfo

This commit is contained in:
Christoph Polcin
2014-10-23 13:15:02 +02:00
parent 542e8e73bc
commit 48d4d0ff90
5 changed files with 69 additions and 69 deletions

View File

@@ -9,6 +9,13 @@ import (
"time"
)
func FixSlash(s string) string {
if !strings.HasSuffix(s, "/") {
s += "/"
}
return s
}
func Join(path0 string, path1 string) string {
return strings.TrimSuffix(path0, "/") + "/" + strings.TrimPrefix(path1, "/")
}
@@ -26,6 +33,13 @@ func parseUint(s *string) uint {
return 0
}
func parseInt64(s *string) int64 {
if n, e := strconv.ParseInt(*s, 10, 64); e == nil {
return n
}
return 0
}
func parseModified(s *string) time.Time {
if t, e := time.Parse(time.RFC1123, *s); e == nil {
return t