Skip to content

Commit

Permalink
*: make golint happy.
Browse files Browse the repository at this point in the history
  • Loading branch information
coocood committed Nov 15, 2016
1 parent cbdb3fd commit 421ceeb
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions evaluator/builtin_other.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func builtinSleep(args []types.Datum, ctx context.Context) (d types.Datum, err e
sessVars := variable.GetSessionVars(ctx)
if args[0].IsNull() {
if sessVars.StrictSQLMode {
return d, errors.New("Incorrect arguments to sleep.")
return d, errors.New("incorrect arguments to sleep")
}
d.SetInt64(0)
return
Expand All @@ -48,7 +48,7 @@ func builtinSleep(args []types.Datum, ctx context.Context) (d types.Datum, err e
}
if ret == -1 {
if sessVars.StrictSQLMode {
return d, errors.New("Incorrect arguments to sleep.")
return d, errors.New("incorrect arguments to sleep")
}
d.SetInt64(0)
return
Expand Down
2 changes: 1 addition & 1 deletion executor/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func (a *statement) Exec(ctx context.Context) (ast.RecordSet, error) {
case *DeleteExec, *InsertExec, *UpdateExec, *ReplaceExec, *LoadData, *DDLExec:
snapshotTS := variable.GetSnapshotTS(ctx)
if snapshotTS != 0 {
return nil, errors.New("Can not execute write statement when 'tidb_snapshot' is set.")
return nil, errors.New("can not execute write statement when 'tidb_snapshot' is set")
}
}

Expand Down
2 changes: 1 addition & 1 deletion executor/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ func (b *executorBuilder) buildIndexScan(v *plan.PhysicalIndexScan) Executor {
st.scanConcurrency, b.err = getScanConcurrency(b.ctx)
return st
}
b.err = errors.New("Not implement yet.")
b.err = errors.New("not implement yet")
return nil
}

Expand Down
2 changes: 1 addition & 1 deletion executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -1855,7 +1855,7 @@ func (e *MaxOneRowExec) Next() (*Row, error) {
return nil, errors.Trace(err)
}
if srcRow1 != nil {
return nil, errors.New("Subquery returns more than 1 row.")
return nil, errors.New("subquery returns more than 1 row")
}
return srcRow, nil
}
Expand Down
2 changes: 1 addition & 1 deletion executor/grant.go
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ func (e *GrantExec) getTargetSchema() (*model.DBInfo, error) {
// Grant *, use current schema
dbName = db.GetCurrentSchema(e.ctx)
if len(dbName) == 0 {
return nil, errors.New("Miss DB name for grant privilege.")
return nil, errors.New("miss DB name for grant privilege")
}
}
//check if db exists
Expand Down
2 changes: 1 addition & 1 deletion executor/show.go
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ func (e *ShowExec) fetchShowGrants() error {
// Get checker
checker := privilege.GetPrivilegeChecker(e.ctx)
if checker == nil {
return errors.New("Miss privilege checker!")
return errors.New("miss privilege checker")
}
gs, err := checker.ShowGrants(e.ctx, e.User)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion plan/logical_plan_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func (b *planBuilder) buildJoin(join *ast.Join) LogicalPlan {
return nil
}
if correlated {
b.err = errors.New("On condition doesn't support subqueries yet.")
b.err = errors.New("ON condition doesn't support subqueries yet")
}
onCondition := expression.SplitCNFItems(onExpr)
eqCond, leftCond, rightCond, otherCond := extractOnCondition(onCondition, leftPlan, rightPlan)
Expand Down
2 changes: 1 addition & 1 deletion plan/planbuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ func (b *planBuilder) extractSelectAgg(sel *ast.SelectStmt) []*ast.AggregateFunc
for _, f := range sel.GetResultFields() {
n, ok := f.Expr.Accept(extractor)
if !ok {
b.err = errors.New("Failed to extract agg expr!")
b.err = errors.New("failed to extract agg expr")
return nil
}
ve, ok := f.Expr.(*ast.ValueExpr)
Expand Down
2 changes: 1 addition & 1 deletion plan/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ func (nr *nameResolver) createResultFields(field *ast.SelectField) (rfs []*ast.R
ctx := nr.currentContext()
if field.WildCard != nil {
if len(ctx.tables) == 0 {
nr.Err = errors.New("No table used.")
nr.Err = errors.New("no table used")
return
}
tableRfs := []*ast.ResultField{}
Expand Down
2 changes: 1 addition & 1 deletion session.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ func (s *session) ExecRestrictedSQL(ctx context.Context, sql string) (ast.Record
}
if len(rawStmts) != 1 {
log.Errorf("ExecRestrictedSQL only executes one statement. Too many/few statement in %s", sql)
return nil, errors.New("Wrong number of statement.")
return nil, errors.New("wrong number of statement")
}
st, err := Compile(s, rawStmts[0])
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion store/localstore/local_region.go
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ func (rs *localRegion) Handle(req *regionRequest) (*regionResponse, error) {
ctx.descScan = sel.OrderBy[0].Desc
} else {
if sel.Limit == nil {
return nil, errors.New("We don't support pushing down Sort without Limit.")
return nil, errors.New("we don't support pushing down Sort without Limit")
}
ctx.topn = true
ctx.topnHeap = &topnHeap{
Expand Down

0 comments on commit 421ceeb

Please sign in to comment.