1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2024-12-02 09:21:40 +02:00
lazygit/pkg/utils/dummies.go
TomCao New Macbook Pro 3d79c6a3d3 formatter
2022-09-17 15:10:41 -07:00

36 lines
788 B
Go

package utils
import (
"io"
"github.com/jesseduffield/lazygit/pkg/common"
"github.com/jesseduffield/lazygit/pkg/config"
"github.com/jesseduffield/lazygit/pkg/i18n"
"github.com/sirupsen/logrus"
)
// NewDummyLog creates a new dummy Log for testing
func NewDummyLog() *logrus.Entry {
log := logrus.New()
log.Out = io.Discard
return log.WithField("test", "test")
}
func NewDummyCommon() *common.Common {
tr := i18n.EnglishTranslationSet()
return &common.Common{
Log: NewDummyLog(),
Tr: &tr,
UserConfig: config.GetDefaultConfig(),
}
}
func NewDummyCommonWithUserConfig(userConfig *config.UserConfig) *common.Common {
tr := i18n.EnglishTranslationSet()
return &common.Common{
Log: NewDummyLog(),
Tr: &tr,
UserConfig: userConfig,
}
}