/
githubmirror
/
syncthing
Обзор
Документация
Войти
/
githubmirror
/
syncthing
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
lib/api/mocked_config_test.go
23 строки
578 B
Simon Frei
lib: Use counterfeiter to mock interfaces in tests (#7375)
03 мар 2021, 10:53
Не верифицирован
03 мар 2021, 10:53
3d91f7c
Код
Авторство
О чём код?
// Copyright (C) 2016 The Syncthing Authors. // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this file, // You can obtain one at https://mozilla.org/MPL/2.0/. package api import ( "github.com/syncthing/syncthing/lib/config/mocks" ) func newMockedConfig() *mocks.Wrapper { m := &mocks.Wrapper{} m.ModifyReturns(noopWaiter{}, nil) m.RemoveFolderReturns(noopWaiter{}, nil) m.RemoveDeviceReturns(noopWaiter{}, nil) return m } type noopWaiter struct{} func (noopWaiter) Wait() {}