1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

introduce Common struct for passing around common stuff

This commit is contained in:
Jesse Duffield
2021-12-29 11:37:15 +11:00
parent b4c078d565
commit 18ab086126
15 changed files with 99 additions and 74 deletions

View File

@ -3,6 +3,9 @@ package utils
import (
"io/ioutil"
"github.com/jesseduffield/lazygit/pkg/common"
"github.com/jesseduffield/lazygit/pkg/config"
"github.com/jesseduffield/lazygit/pkg/i18n"
"github.com/sirupsen/logrus"
)
@ -12,3 +15,13 @@ func NewDummyLog() *logrus.Entry {
log.Out = ioutil.Discard
return log.WithField("test", "test")
}
func NewDummyCommon() *common.Common {
tr := i18n.EnglishTranslationSet()
newAppConfig := config.NewDummyAppConfig()
return &common.Common{
Log: NewDummyLog(),
Tr: &tr,
UserConfig: newAppConfig.GetUserConfig(),
}
}