diff options
Diffstat (limited to 'bind/util.go')
-rw-r--r-- | bind/util.go | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/bind/util.go b/bind/util.go new file mode 100644 index 0000000..cc0ef23 --- /dev/null +++ b/bind/util.go | |||
@@ -0,0 +1,17 @@ | |||
1 | package bind | ||
2 | |||
3 | import ( | ||
4 | "strings" | ||
5 | ) | ||
6 | |||
7 | func DeCanonicalize(z string) string { | ||
8 | return strings.TrimRight(z, ".") | ||
9 | } | ||
10 | |||
11 | func Canonicalize(z string) string { | ||
12 | if !strings.HasSuffix(z, ".") { | ||
13 | return z + "." | ||
14 | } else { | ||
15 | return z | ||
16 | } | ||
17 | } | ||