Skip to content

Commit 8e7c329

Browse files
LENSHOODti-srebot
andauthored
fix: string(int) expression not allowed on Go1.15 (pingcap#1003)
Make test will fail due to Go1.15 starts to not allow "string(int)" expression. Fix affected sources by replace such expression to legal expressions. More info about ban string(int), see: golang/go#3939 Co-authored-by: ti-srebot <66930949+ti-srebot@users.noreply.github.com>
1 parent c24f8b1 commit 8e7c329

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ast/ddl.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1077,7 +1077,7 @@ func (n *DropTableStmt) Restore(ctx *format.RestoreCtx) error {
10771077
ctx.WritePlain(", ")
10781078
}
10791079
if err := table.Restore(ctx); err != nil {
1080-
return errors.Annotate(err, "An error occurred while restore DropTableStmt.Tables "+string(index))
1080+
return errors.Annotatef(err, "An error occurred while restore DropTableStmt.Tables[%d]", index)
10811081
}
10821082
}
10831083

lexer_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ func (s *testLexerSuite) TestscanString(c *C) {
201201
{`' \n\tTest String'`, " \n\tTest String"},
202202
{`'\x\B'`, "xB"},
203203
{`'\0\'\"\b\n\r\t\\'`, "\000'\"\b\n\r\t\\"},
204-
{`'\Z'`, string(26)},
204+
{`'\Z'`, "\x1a"},
205205
{`'\%\_'`, `\%\_`},
206206
{`'hello'`, "hello"},
207207
{`'"hello"'`, `"hello"`},

0 commit comments

Comments
 (0)