{"record":{"id":"0b382c479b5a2aaa","repo":"grafana/k6","slug":"delimiter-must-be-a-single-character","errorCode":null,"errorMessage":"delimiter must be a single character","messagePattern":"delimiter must be a single character","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/js/modules/k6/experimental/csv/module.go","lineNumber":340,"sourceCode":"\t\tSkipFirstLine: false,\n\t\tAsObjects:     null.BoolFrom(false),\n\t}\n}\n\n// newParserOptions creates a new options instance from the given Sobek object.\nfunc newParserOptionsFrom(obj *sobek.Object) (options, error) {\n\toptions := newDefaultParserOptions()\n\n\tif obj == nil {\n\t\treturn options, nil\n\t}\n\n\tif v := obj.Get(\"delimiter\"); v != nil {\n\t\tdelimiter := v.String()\n\n\t\t// A delimiter is gonna be treated as a rune in the Go code, so we need to make sure it's a single character.\n\t\tif len(delimiter) > 1 {\n\t\t\treturn options, fmt.Errorf(\"delimiter must be a single character\")\n\t\t}\n\n\t\toptions.Delimiter = rune(delimiter[0])\n\t}\n\n\tif v := obj.Get(\"skipFirstLine\"); v != nil {\n\t\toptions.SkipFirstLine = v.ToBoolean()\n\t}\n\n\tif v := obj.Get(\"fromLine\"); v != nil {\n\t\toptions.FromLine = null.IntFrom(v.ToInteger())\n\t}\n\n\tif v := obj.Get(\"toLine\"); v != nil {\n\t\toptions.ToLine = null.IntFrom(v.ToInteger())\n\t}\n\n\tif v := obj.Get(\"asObjects\"); v != nil {","sourceCodeStart":322,"sourceCodeEnd":358,"githubUrl":"https://github.com/grafana/k6/blob/01ffac6f245854c1b8adc6a69857c76a15f90022/internal/js/modules/k6/experimental/csv/module.go#L322-L358","documentation":"Raised in newParserOptionsFrom when the csv.Parse/csv.NewParser options object has a 'delimiter' property whose string value is longer than one character. The delimiter is converted to a rune internally, so multi-character strings are rejected by this guard.","triggerScenarios":"Thrown at internal/js/modules/k6/experimental/csv/module.go:340 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set the delimiter option to a single character string, e.g. {delimiter: ';'} or {delimiter: '\\t'}","Remove the delimiter option to use the default ','","If a multi-character separator is needed, preprocess the file or split manually since Go's csv package only supports single-rune delimiters"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ffac6f245854c1b8adc6a69857c76a15f90022","analyzedAt":"2026-08-18T03:05:52.393Z","contentChangedAt":"2026-08-18T03:05:52.393Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}