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:
@ -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(),
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user