Skip to content

Commit

Permalink
Fix some formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Shivaprasad authored and spy16 committed Aug 23, 2020
1 parent ce5115e commit 03c7aea
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ vendor/
expt/
.vscode/
dev/
.idea/

test.db
fabric.db
14 changes: 8 additions & 6 deletions sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ import (
"strings"
)

var _ Store = &SQLStore{}
var _ ReWeighter = &SQLStore{}
var _ Counter = &SQLStore{}
var (
_ Store = &SQLStore{}
_ ReWeighter = &SQLStore{}
_ Counter = &SQLStore{}
)

// SQLStore implements Store interface using the Go standard library
// sql package.
Expand Down Expand Up @@ -73,7 +75,7 @@ func (ss *SQLStore) Query(ctx context.Context, query Query) ([]Triple, error) {
}
defer rows.Close()

triples := []Triple{}
var triples []Triple
for rows.Next() {
var tri Triple
if err := rows.Scan(&tri.Source, &tri.Predicate, &tri.Target, &tri.Weight); err != nil {
Expand Down Expand Up @@ -160,8 +162,8 @@ func (ss *SQLStore) Setup(ctx context.Context) error {
}

func getWhereClause(query Query) (string, []interface{}, error) {
where := []string{}
args := []interface{}{}
var where []string
var args []interface{}
for col, clause := range query.Map() {
sqlOp, value, err := toSQL(clause)
if err != nil {
Expand Down

0 comments on commit 03c7aea

Please sign in to comment.