features: print warning for stable/depreacted feature flags
This commit is contained in:
parent
fe68d2cafb
commit
a9b64cd7ad
4 changed files with 35 additions and 17 deletions
|
@ -15,13 +15,17 @@ import (
|
|||
func TestSetFlag(t *testing.T, f *FlagSet, flag FlagName, value bool) func() {
|
||||
current := f.Enabled(flag)
|
||||
|
||||
if err := f.Apply(fmt.Sprintf("%s=%v", flag, value)); err != nil {
|
||||
panicIfCalled := func(msg string) {
|
||||
panic(msg)
|
||||
}
|
||||
|
||||
if err := f.Apply(fmt.Sprintf("%s=%v", flag, value), panicIfCalled); err != nil {
|
||||
// not reachable
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return func() {
|
||||
if err := f.Apply(fmt.Sprintf("%s=%v", flag, current)); err != nil {
|
||||
if err := f.Apply(fmt.Sprintf("%s=%v", flag, current), panicIfCalled); err != nil {
|
||||
// not reachable
|
||||
panic(err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue