MCPcopy
hub / github.com/syncthing/syncthing / copyAndLoad

Function copyAndLoad

lib/config/config_test.go:1368–1381  ·  view source on GitHub ↗
(fs fs.Filesystem, path string, myID protocol.DeviceID)

Source from the content-addressed store, hash-verified

1366}
1367
1368func copyAndLoad(fs fs.Filesystem, path string, myID protocol.DeviceID) (*testWrapper, func(), error) {
1369 temp, err := copyToTmp(fs, path)
1370 if err != nil {
1371 return nil, func() {}, err
1372 }
1373 wrapper, err := loadTest(fs, temp, myID)
1374 if err != nil {
1375 return nil, func() {}, err
1376 }
1377 return wrapper, func() {
1378 fs.Remove(temp)
1379 wrapper.stop()
1380 }, nil
1381}
1382
1383func loadTest(fs fs.Filesystem, path string, myID protocol.DeviceID) (*testWrapper, error) {
1384 cfg, _, err := loadWrapTest(fs, path, myID, events.NoopLogger)

Callers 15

TestDeviceConfigFunction · 0.85
TestNoListenAddressesFunction · 0.85
TestOverriddenValuesFunction · 0.85
TestDeviceCompressionFunction · 0.85
TestVersioningConfigFunction · 0.85
TestIssue1262Function · 0.85
TestIssue1750Function · 0.85
TestCopyFunction · 0.85
TestPullOrderFunction · 0.85
TestLargeRescanIntervalFunction · 0.85

Calls 4

copyToTmpFunction · 0.85
loadTestFunction · 0.85
stopMethod · 0.80
RemoveMethod · 0.65

Tested by

no test coverage detected