talent-plan/tinysql

go build failure in project 2 test file

ClSlaid opened this issue · 0 comments

Environment Details:
System:  Manjaro Linux x86_64
Kernel: 5.10.7-1-MANJARO
Go Version: 1.15.6

find a bug in tinysql/parser/lexer_test.go
if run go test under directory tinysql/parser, go build would fail with

# github.com/pingcap/tidb/parser
./lexer_test.go:199:12: conversion from untyped int to string yields a string of one rune, not a string of digits (did you mean fmt.Sprint(x)?)
FAIL    github.com/pingcap/tidb/parser [build failed]

by changing line 199 solve the problem

// {`'\Z'`, string(26)},
{`'\z'`, string(rune(26))},

this error may be caused by higher Go version.