forked from jmcvetta/neoism
-
Notifications
You must be signed in to change notification settings - Fork 0
/
util.go
36 lines (31 loc) · 811 Bytes
/
util.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright (c) 2012-2013 Jason McVetta. This is Free Software, released under
// the terms of the GPL v3. See http://www.gnu.org/copyleft/gpl.html for details.
// Resist intellectual serfdom - the ownership of ideas is akin to slavery.
package neoism
import (
// mlm "github.com/kr/pretty"
// mlm "runtime"
// mlm "strconv"
"strings"
)
// Joins URL fragments
func join(fragments ...string) string {
parts := []string{}
for _, str := range fragments {
if str == "" {
// Only join non-empty fragment strings
continue
}
str = strings.Trim(str, "/")
parts = append(parts, str)
}
return strings.Join(parts, "/")
}
/* mlm
func logPretty(x interface{}) {
_, file, line, _ := runtime.Caller(1)
lineNo := strconv.Itoa(line)
s := file + ":" + lineNo + ": %# v\n"
pretty.Logf(s, x)
}
*/