MCPcopy Create free account
hub / github.com/cloudwan/gohan / setupConfig

Function setupConfig

extension/framework/framework.go:41–63  ·  view source on GitHub ↗
(c *cli.Context)

Source from the content-addressed store, hash-verified

39)
40
41func setupConfig(c *cli.Context) *util.Config {
42 l.SetUpBasicLogging(logWriter, l.DefaultFormat)
43
44 var config *util.Config
45 configFilePath := c.String("config-file")
46
47 if configFilePath != "" && !c.Bool("verbose") {
48 config = util.GetConfig()
49 err := config.ReadConfig(configFilePath)
50 if err != nil {
51 log.Error(fmt.Sprintf("Failed to read config from path %s: %v", configFilePath, err))
52 os.Exit(1)
53 }
54
55 err = l.SetUpLogging(config)
56 if err != nil {
57 log.Error(fmt.Sprintf("Failed to set up logging: %v", err))
58 os.Exit(1)
59 }
60 }
61
62 return config
63}
64
65// TestExtensions runs extension tests when invoked from Gohan CLI
66func TestExtensions(context *cli.Context) {

Callers 1

TestExtensionsFunction · 0.85

Calls 3

ReadConfigMethod · 0.95
ErrorMethod · 0.65
StringMethod · 0.45

Tested by 1

TestExtensionsFunction · 0.68