mirror of
https://github.com/octoleo/restic.git
synced 2024-12-23 11:28:54 +00:00
rename LocationParse -> Parse
This commit is contained in:
parent
3d2a714b5a
commit
d257dedf42
@ -29,11 +29,11 @@ var parsers = []parser{
|
||||
{"s3", s3.ParseConfig},
|
||||
}
|
||||
|
||||
// ParseLocation parses a repository location from the string s. If s starts with a
|
||||
// backend name followed by a colon, that backend's Parse() function is called.
|
||||
// Otherwise, the local backend is used which interprets s as the name of a
|
||||
// directory.
|
||||
func ParseLocation(s string) (u Location, err error) {
|
||||
// Parse extracts repository location information from the string s. If s
|
||||
// starts with a backend name followed by a colon, that backend's Parse()
|
||||
// function is called. Otherwise, the local backend is used which interprets s
|
||||
// as the name of a directory.
|
||||
func Parse(s string) (u Location, err error) {
|
||||
scheme := extractScheme(s)
|
||||
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 {
|
||||
u, err := ParseLocation(test.s)
|
||||
u, err := Parse(test.s)
|
||||
if err != nil {
|
||||
t.Errorf("unexpected error: %v", err)
|
||||
continue
|
||||
|
Loading…
Reference in New Issue
Block a user