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

Function getContextWithConfig

cli/cli_test.go:36–49  ·  view source on GitHub ↗
(configFile string, useEtcd bool)

Source from the content-addressed store, hash-verified

34const useEtcdEnv = "USE_ETCD_DURING_MIGRATIONS"
35
36func getContextWithConfig(configFile string, useEtcd bool) *cli.Context {
37 if useEtcd {
38 os.Setenv(useEtcdEnv, "true")
39 }
40
41 configFlag := cli.StringFlag{Name: "config-file", Value: configFile}
42 useEtcdFlag := cli.BoolFlag{Name: FlagLockWithETCD, EnvVar: useEtcdEnv}
43
44 set := flag.NewFlagSet("", flag.ContinueOnError)
45 configFlag.Apply(set)
46 useEtcdFlag.Apply(set)
47
48 return cli.NewContext(nil, set, &cli.Context{})
49}
50
51var _ = Describe("CLI", func() {
52 const (

Callers 1

cli_test.goFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected