mirror of
https://github.com/restic/restic.git
synced 2026-02-03 20:39:52 -05:00
20 lines
448 B
Go
20 lines
448 B
Go
package restic
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
// TestParseID parses s as a ID and panics if that fails.
|
|
func TestParseID(s string) ID {
|
|
id, err := ParseID(s)
|
|
if err != nil {
|
|
panic(fmt.Sprintf("unable to parse string %q as ID: %v", s, err))
|
|
}
|
|
|
|
return id
|
|
}
|
|
|
|
// TestParseHandle parses s as a ID, panics if that fails and creates a BlobHandle with t.
|
|
func TestParseHandle(s string, t BlobType) BlobHandle {
|
|
return BlobHandle{ID: TestParseID(s), Type: t}
|
|
}
|