You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now, we run resolveConfig to do configtest and detect Invalid syntax (config_test.go shows that).
But, we can't detect unexpected key, so I want to improve by using Undecoded().
It would be better if it could suggest intended key.
This is sample of mackerel-agent.conf which includes unexpected key.
$ mackerel-agent configtest
/path/to/mackerel-agent.conf Syntax OK
Expected behavior
$ mackerel-agent configtest
warn: podfile is invalid key. Do you mean pidfile ?(line 2)
warn: foo is invalid key (line 4)
warn: plugins.checks.foo is invalid key. Do you mean plugin.checks.foo ? (line 7)
warn: plugin.check.foo is invalid key. Do you mean plugin.checks.foo ? (line 10)
Implementation image
Create config/validate.go#ValidateConfigFile and use it in commands.go#doConfigtest
Now, we run
resolveConfig
to do configtest and detect Invalid syntax (config_test.go shows that).But, we can't detect unexpected key, so I want to improve by using Undecoded().
It would be better if it could suggest intended key.
This is sample of
mackerel-agent.conf
which includes unexpected key.Actual behavior
Expected behavior
Implementation image
Create
config/validate.go#ValidateConfigFile
and use it incommands.go#doConfigtest
Implementation stage
mackerel-agent configtest
: detect unexpected key #813mackerel-agent configtest
: Add suggestion to unexpected keys #818The text was updated successfully, but these errors were encountered: