rename LocationParse -> Parse
This commit is contained in:
parent
3d2a714b5a
commit
d257dedf42
2 changed files with 7 additions and 7 deletions
|
@ -29,11 +29,11 @@ var parsers = []parser{
|
||||||
{"s3", s3.ParseConfig},
|
{"s3", s3.ParseConfig},
|
||||||
}
|
}
|
||||||
|
|
||||||
// ParseLocation parses a repository location from the string s. If s starts with a
|
// Parse extracts repository location information from the string s. If s
|
||||||
// backend name followed by a colon, that backend's Parse() function is called.
|
// starts with a backend name followed by a colon, that backend's Parse()
|
||||||
// Otherwise, the local backend is used which interprets s as the name of a
|
// function is called. Otherwise, the local backend is used which interprets s
|
||||||
// directory.
|
// as the name of a directory.
|
||||||
func ParseLocation(s string) (u Location, err error) {
|
func Parse(s string) (u Location, err error) {
|
||||||
scheme := extractScheme(s)
|
scheme := extractScheme(s)
|
||||||
u.Scheme = scheme
|
u.Scheme = scheme
|
||||||
|
|
||||||
|
|
|
@ -64,9 +64,9 @@ var parseTests = []struct {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestParseLocation(t *testing.T) {
|
func TestParse(t *testing.T) {
|
||||||
for i, test := range parseTests {
|
for i, test := range parseTests {
|
||||||
u, err := ParseLocation(test.s)
|
u, err := Parse(test.s)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Errorf("unexpected error: %v", err)
|
t.Errorf("unexpected error: %v", err)
|
||||||
continue
|
continue
|
||||||
|
|
Loading…
Add table
Reference in a new issue