diff --git a/engine/agnostic/change.go b/engine/agnostic/change.go index d074787..9d1d036 100644 --- a/engine/agnostic/change.go +++ b/engine/agnostic/change.go @@ -39,7 +39,7 @@ func (t *Transaction) rollbackValueChange(c ValueChange) { if c.current != nil && c.old != nil { cur := c.current.Value.(*Tuple) old := c.old.Value.(*Tuple) - for i, _ := range cur.values { + for i := range cur.values { cur.values[i] = old.values[i] } } diff --git a/engine/agnostic/relation.go b/engine/agnostic/relation.go index d1c70bd..9a42f4a 100644 --- a/engine/agnostic/relation.go +++ b/engine/agnostic/relation.go @@ -62,7 +62,7 @@ func (r *Relation) CheckPrimaryKey(tuple *Tuple) (bool, error) { } var index Index - for i, _ := range r.indexes { + for i := range r.indexes { if strings.HasPrefix(r.indexes[i].Name(), "pk") { index = r.indexes[i] break @@ -135,7 +135,7 @@ func (r *Relation) Truncate() int64 { return int64(l) } -func (r Relation) String() string { +func (r *Relation) String() string { if r.schema != "" { return r.schema + "." + r.name } diff --git a/engine/agnostic/tuple.go b/engine/agnostic/tuple.go index 26cdc28..ee93d0f 100644 --- a/engine/agnostic/tuple.go +++ b/engine/agnostic/tuple.go @@ -9,9 +9,7 @@ type Tuple struct { func NewTuple(values ...any) *Tuple { t := &Tuple{} - for _, v := range values { - t.values = append(t.values, v) - } + t.values = append(t.values, values...) return t } diff --git a/engine/parser/lexer.go b/engine/parser/lexer.go index 6e82c03..8bdbc07 100644 --- a/engine/parser/lexer.go +++ b/engine/parser/lexer.go @@ -504,7 +504,7 @@ func (l *lexer) MatchEscapedStringToken() bool { escaped := l.instruction[l.pos+2 : i-1] for _, r := range escaped { - if unicode.IsDigit(rune(r)) == false { + if !unicode.IsDigit(rune(r)) { tok = StringToken } } diff --git a/engine/parser/select.go b/engine/parser/select.go index cd71d12..445cc15 100644 --- a/engine/parser/select.go +++ b/engine/parser/select.go @@ -132,7 +132,7 @@ func (p *parser) parseSelect(tokens []Token) (*Instruction, error) { } hazWhereClause = true case OrderToken: - if hazWhereClause == false { + if !hazWhereClause { // WHERE clause is implicit addImplicitWhereAll(selectDecl) }