Closed elfranne closed 1 year ago
Can you use SliceOptionValue?
@echlebek Can you explain a bit more what you mean ?
I was probably a bit tired, i ll give it a try.
@elfranne A while back, I made a way of handling slices as options that differs from the regular option handling. https://github.com/sensu/sensu-plugin-sdk/blob/master/sensu/plugin.go#L57
SliceOptionValue is a generic type constraint that can be used with SlicePluginConfigOption for handling slices. I made this to avoid awkwardness when dealing with slice types, to simplify the PluginConfigOption code. There is also, similarly, a MapPluginConfigOption.
Thanks for the explanation, I managed to use that instead.
Have been trying to update sensu/http-checks but it has a
--headers
CLI argument that uses[]string
as data type. (WIP for http-check)The test code was already present.