mirror of
https://github.com/livekit/livekit.git
synced 2026-10-22 15:22:30 +00:00
baseFlags do not need to be set (#1127)
This commit is contained in:
1 parent
7223d9c132
commit
b2493b49f7
2 files changed
+3
-2
No files matched your search
@@ -473,8 +473,8 @@ func (conf *Config) updateFromCLI(c *cli.Context, baseFlags []cli.Flag) error {
|
||||
for _, flag := range c.App.Flags {
|
||||
flagName := flag.Names()[0]
|
||||
|
||||
// the `len(baseFlags) > 0` check is needed because `c.IsSet(...)` is always false in unit tests
|
||||
if !c.IsSet(flagName) && len(baseFlags) > 0 {
|
||||
// the `c.App.Name != "test"` check is needed because `c.IsSet(...)` is always false in unit tests
|
||||
if !c.IsSet(flagName) && c.App.Name != "test" {
|
||||
continue
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ func TestGeneratedFlags(t *testing.T) {
|
||||
require.NoError(t, err)
|
||||
|
||||
app := cli.NewApp()
|
||||
app.Name = "test"
|
||||
app.Flags = append(app.Flags, generatedFlags...)
|
||||
|
||||
set := flag.NewFlagSet("test", 0)
|
||||
|
||||
Reference in new issue
Block a user