{"record":{"id":"6e949830df750768","repo":"owasp-amass/amass","slug":"invalid-type-for-confidence-in-default-transform-v","errorCode":null,"errorMessage":"invalid type for confidence in default_transform_values","messagePattern":"invalid type for confidence in default_transform_values","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/transform.go","lineNumber":88,"sourceCode":"\nfunc (c *Config) loadGlobalTransformSettings() error {\n\t// get the default_transfom_values in the config yaml\n\tif dtv, ok := c.Options[\"default_transform_values\"]; ok {\n\t\t// Assert the type to map[interface{}]interface{}\n\t\tdtvMap, ok := dtv.(map[string]interface{})\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"invalid type for default_transform_values\")\n\t\t}\n\t\t// Convert the map to the Transformation struct\n\t\tif ttl, ok := dtvMap[\"ttl\"].(int); ok {\n\t\t\tc.DefaultTransformations.TTL = ttl\n\t\t} else if !ok && dtvMap[\"ttl\"] != nil {\n\t\t\treturn fmt.Errorf(\"invalid type for ttl in default_transform_values\")\n\t\t}\n\t\tif confidence, ok := dtvMap[\"confidence\"].(int); ok {\n\t\t\tc.DefaultTransformations.Confidence = confidence\n\t\t} else if !ok && dtvMap[\"confidence\"] != nil {\n\t\t\treturn fmt.Errorf(\"invalid type for confidence in default_transform_values\")\n\t\t}\n\t\tif priority, ok := dtvMap[\"priority\"].(int); ok {\n\t\t\tc.DefaultTransformations.Priority = priority\n\t\t} else if !ok && dtvMap[\"priority\"] != nil {\n\t\t\treturn fmt.Errorf(\"invalid type for priority in default_transform_values\")\n\t\t}\n\n\t}\n\treturn nil\n}\n\n// Split splits the key into 'From' and 'To' components, expecting a \"->\" delimiter.\n// Requires a non-nil Transformation pointer and a valid key format. Example: FQDN->IPaddress.\nfunc (t *Transformation) Split(key string) error {\n\tif t.From != \"\" && t.To != \"\" {\n\t\tt.From = strings.ToLower(t.From)\n\t\tt.To = strings.ToLower(t.To)\n\t\treturn nil // Already split","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/owasp-amass/amass/blob/79299dce87b0085db0f2f4ef3e9c52cccb49f514/config/transform.go#L70-L106","documentation":"loadGlobalTransformSettings found a 'default_transform_values' option in the config, but it is not a map[string]interface{} — the type assertion fails (typically the YAML value is a scalar or a list). This is a shape guard on the config entry; the offending input is the default_transform_values value itself, before any per-field (ttl/confidence) extraction happens.","triggerScenarios":"YAML like 'confidence: \"high\"' or 'confidence: 0.8' inside default_transform_values — strings or floats fail the .(int) assertion.","commonSituations":"Expressing confidence as a decimal 0-1 or a descriptive word instead of the integer scale the library expects.","solutions":["Use an integer confidence value (e.g. confidence: 80) matching the library's scale","Convert 0.8-style decimals to integers (80) before writing the config","Quote nothing: keep it an unquoted YAML integer"],"exampleFix":"// before\ndefault_transform_values:\n  confidence: 0.8\n// after\ndefault_transform_values:\n  confidence: 80","handlingStrategy":"type-guard","validationCode":"if v, ok := dtv[\"confidence\"]; ok && v != nil {\n\tif _, isInt := v.(int); !isInt {\n\t\treturn errors.New(\"confidence in default_transform_values must be an integer\")\n\t}\n}","typeGuard":"func isInt(v interface{}) bool { _, ok := v.(int); return ok }","tryCatchPattern":"if err := cfg.LoadSettings(path); err != nil && strings.Contains(err.Error(), \"invalid type for confidence\") {\n\treturn fmt.Errorf(\"confidence must be an integer in %s\", path)\n}","preventionTips":["Use the library's integer confidence scale, not decimals or words","Keep the value unquoted in YAML","Document valid confidence ranges in your config template"],"tags":["config","yaml","type-error","confidence","amass"],"backgroundTag":"config-type-mismatch","analyzedSha":"79299dce87b0085db0f2f4ef3e9c52cccb49f514","analyzedAt":"2026-09-06T08:22:48.198Z","contentChangedAt":"2026-09-06T08:22:48.198Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}