{"id":"6282a69f5de62bee","repo":"jackc/pgx","slug":"cannot-convert-v-to-line","errorCode":null,"errorMessage":"cannot convert %v to Line","messagePattern":"cannot convert (.+?) to Line","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pgtype/line.go","lineNumber":38,"sourceCode":"\ntype Line struct {\n\tA, B, C float64\n\tValid   bool\n}\n\n// ScanLine implements the [LineScanner] interface.\nfunc (line *Line) ScanLine(v Line) error {\n\t*line = v\n\treturn nil\n}\n\n// LineValue implements the [LineValuer] interface.\nfunc (line Line) LineValue() (Line, error) {\n\treturn line, nil\n}\n\nfunc (line *Line) Set(src any) error {\n\treturn fmt.Errorf(\"cannot convert %v to Line\", src)\n}\n\n// Scan implements the [database/sql.Scanner] interface.\nfunc (line *Line) Scan(src any) error {\n\tif src == nil {\n\t\t*line = Line{}\n\t\treturn nil\n\t}\n\n\tif src, ok := src.(string); ok {\n\t\treturn scanPlanTextAnyToLineScanner{}.Scan([]byte(src), line)\n\t}\n\n\treturn fmt.Errorf(\"cannot scan %T\", src)\n}\n\n// Value implements the [database/sql/driver.Valuer] interface.\nfunc (line Line) Value() (driver.Value, error) {","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/pgtype/line.go#L20-L56","documentation":"Error \"cannot convert %v to Line\" thrown in jackc/pgx.","triggerScenarios":"Thrown at pgtype/line.go:38 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"ec1a0befd22592cffffdeeb0a50311b506372f4c","analyzedAt":"2026-08-04T22:52:11.263Z","schemaVersion":2}