MCPcopy Index your code
hub / github.com/git-bug/git-bug / validateParams

Function validateParams

bridge/core/bridge.go:222–236  ·  view source on GitHub ↗
(params BridgeParams, impl BridgeImpl)

Source from the content-addressed store, hash-verified

220}
221
222func validateParams(params BridgeParams, impl BridgeImpl) {
223 validParams := impl.ValidParams()
224
225 paramsValue := reflect.ValueOf(params)
226 paramsType := paramsValue.Type()
227
228 for i := 0; i < paramsValue.NumField(); i++ {
229 name := paramsType.Field(i).Name
230 val := paramsValue.Field(i).Interface().(string)
231 _, valid := validParams[name]
232 if val != "" && !valid {
233 _, _ = fmt.Fprintln(os.Stderr, params.fieldWarning(name, impl.Target()))
234 }
235 }
236}
237
238func (b *Bridge) storeConfig(conf Configuration) error {
239 for key, val := range conf {

Callers 1

ConfigureMethod · 0.85

Calls 4

fieldWarningMethod · 0.80
ValidParamsMethod · 0.65
TypeMethod · 0.65
TargetMethod · 0.65

Tested by

no test coverage detected