mirror of
https://github.com/octoleo/restic.git
synced 2024-12-02 01:48:30 +00:00
f903db492c
In order to change the backend initialization in `global.go` to be able to generically call cfg.ApplyEnvironment() for supported backends, the `interface{}` returned by `ParseConfig` must contain a pointer to the configuration. An alternative would be to use reflection to convert the type from `interface{}(Config)` to `interface{}(*Config)` (from value to pointer type). However, this would just complicate the type mess further.
19 lines
323 B
Go
19 lines
323 B
Go
package local
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/restic/restic/internal/backend/test"
|
|
)
|
|
|
|
var configTests = []test.ConfigTestData[Config]{
|
|
{S: "local:/some/path", Cfg: Config{
|
|
Path: "/some/path",
|
|
Connections: 2,
|
|
}},
|
|
}
|
|
|
|
func TestParseConfig(t *testing.T) {
|
|
test.ParseConfigTester(t, ParseConfig, configTests)
|
|
}
|