Skip to content

Commit 2b39f60

Browse files
committed
Drop (Escape|Unescape)PluginName
Change-Id: I8b213a52dbd96c510e4f7173324e198f4caf55fd
1 parent 41bae72 commit 2b39f60

File tree

2 files changed

+0
-34
lines changed

2 files changed

+0
-34
lines changed

strings/escape.go

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,6 @@ import (
2020
"strings"
2121
)
2222

23-
// EscapePluginName converts a plugin name in the format
24-
// vendor/pluginname into a proper ondisk vendor~pluginname plugin directory
25-
// format.
26-
func EscapePluginName(in string) string {
27-
return strings.Replace(in, "/", "~", -1)
28-
}
29-
30-
// UnescapePluginName converts a plugin directory name in the format
31-
// vendor~pluginname into a proper vendor/pluginname.
32-
func UnescapePluginName(in string) string {
33-
return strings.Replace(in, "~", "/", -1)
34-
}
35-
3623
// EscapeQualifiedName converts a plugin name, which might contain a / into a
3724
// string that is safe to use on-disk. This assumes that the input has already
3825
// been validates as a qualified name. we use "~" rather than ":" here in case

strings/escape_test.go

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,27 +20,6 @@ import (
2020
"testing"
2121
)
2222

23-
func TestEscapePluginName(t *testing.T) {
24-
testCases := []struct {
25-
input string
26-
output string
27-
}{
28-
{"kubernetes.io/blah", "kubernetes.io~blah"},
29-
{"blah/blerg/borg", "blah~blerg~borg"},
30-
{"kubernetes.io", "kubernetes.io"},
31-
}
32-
for i, tc := range testCases {
33-
escapee := EscapePluginName(tc.input)
34-
if escapee != tc.output {
35-
t.Errorf("case[%d]: expected (%q), got (%q)", i, tc.output, escapee)
36-
}
37-
original := UnescapePluginName(escapee)
38-
if original != tc.input {
39-
t.Errorf("case[%d]: expected (%q), got (%q)", i, tc.input, original)
40-
}
41-
}
42-
}
43-
4423
func TestEscapeQualifiedNameForDisk(t *testing.T) {
4524
testCases := []struct {
4625
input string

0 commit comments

Comments
 (0)