{"record":{"id":"bea0d1cd45a83bf2","repo":"hashicorp/packer","slug":"no-value-in-arg-s","errorCode":null,"errorMessage":"No '=' value in arg: %s","messagePattern":"No '=' value in arg: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"command/flag-kv/flag.go","lineNumber":22,"sourceCode":"package kvflag\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n)\n\n// Flag is a flag.Value implementation for parsing user variables\n// from the command-line in the format of '-var key=value'.\ntype Flag map[string]string\n\nfunc (v *Flag) String() string {\n\treturn \"\"\n}\n\nfunc (v *Flag) Set(raw string) error {\n\tidx := strings.Index(raw, \"=\")\n\tif idx == -1 {\n\t\treturn fmt.Errorf(\"No '=' value in arg: %s\", raw)\n\t}\n\n\tif *v == nil {\n\t\t*v = make(map[string]string)\n\t}\n\n\tkey, value := raw[0:idx], raw[idx+1:]\n\t(*v)[key] = value\n\treturn nil\n}\n","sourceCodeStart":4,"sourceCodeEnd":33,"githubUrl":"https://github.com/hashicorp/packer/blob/eb36e3c3e48a036f3e8cc94087636ee72e1303c9/command/flag-kv/flag.go#L4-L33","documentation":"CLI flag parsing error from the -var key=value flag parser: the argument contains no '=' separator, so it cannot be split into a variable name and value. Detected via strings.Index(raw, \"=\") returning -1.","triggerScenarios":"Thrown at command/flag-kv/flag.go:22 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rewrite the argument as -var key=value with an equals sign","Quote the whole flag if the value contains spaces: -var \"key=some value\""],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"eb36e3c3e48a036f3e8cc94087636ee72e1303c9","analyzedAt":"2026-09-05T13:20:43.127Z","contentChangedAt":"2026-09-05T13:20:43.127Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}