Skip to content
This repository has been archived by the owner on Jan 28, 2021. It is now read-only.

Commit

Permalink
gofmt + goimports
Browse files Browse the repository at this point in the history
Signed-off-by: Juanjo Alvarez <juanjo@sourced.tech>
  • Loading branch information
Juanjo Alvarez committed Aug 20, 2019
1 parent 5688ee6 commit 6aa453e
Show file tree
Hide file tree
Showing 107 changed files with 142 additions and 138 deletions.
2 changes: 1 addition & 1 deletion auth/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package auth
import (
"strings"

"gopkg.in/src-d/go-errors.v1"
"github.com/src-d/go-mysql-server/sql"
"gopkg.in/src-d/go-errors.v1"
"vitess.io/vitess/go/mysql"
)

Expand Down
2 changes: 1 addition & 1 deletion auth/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import (
"os"
"testing"

"github.com/stretchr/testify/require"
sqle "github.com/src-d/go-mysql-server"
"github.com/src-d/go-mysql-server/auth"
"github.com/src-d/go-mysql-server/memory"
"github.com/src-d/go-mysql-server/server"
"github.com/src-d/go-mysql-server/sql"
"github.com/src-d/go-mysql-server/sql/analyzer"
"github.com/src-d/go-mysql-server/sql/index/pilosa"
"github.com/stretchr/testify/require"
)

const port = 3336
Expand Down
2 changes: 1 addition & 1 deletion internal/similartext/similartext_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func TestFindFromMap(t *testing.T) {
res := FindFromMap(names, "")
require.Empty(res)

names = map[string]int {
names = map[string]int{
"foo": 1,
"bar": 2,
}
Expand Down
5 changes: 3 additions & 2 deletions internal/sockstate/sockstate.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package sockstate

import (
"fmt"
"gopkg.in/src-d/go-errors.v1"
"net"
"os"
"strconv"
"strings"

"gopkg.in/src-d/go-errors.v1"
)

type SockState uint8
Expand Down Expand Up @@ -34,7 +35,7 @@ func GetConnInode(c *net.TCPConn) (n uint64, err error) {
}

if strings.HasPrefix(socketLnk, sockPrefix) {
_, err = fmt.Sscanf(socketLnk, sockPrefix + "%d]", &n)
_, err = fmt.Sscanf(socketLnk, sockPrefix+"%d]", &n)
if err != nil {
return
}
Expand Down
2 changes: 1 addition & 1 deletion memory/database_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package memory
import (
"testing"

"github.com/stretchr/testify/require"
"github.com/src-d/go-mysql-server/sql"
"github.com/stretchr/testify/require"
)

func TestDatabase_Name(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion memory/table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"io"
"testing"

"github.com/stretchr/testify/require"
"github.com/src-d/go-mysql-server/sql"
"github.com/src-d/go-mysql-server/sql/expression"
"github.com/stretchr/testify/require"
)

func TestTablePartitionsCount(t *testing.T) {
Expand Down
3 changes: 2 additions & 1 deletion server/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package server

import (
"context"
"sync"

"github.com/opentracing/opentracing-go"
"github.com/src-d/go-mysql-server/sql"
"sync"
"vitess.io/vitess/go/mysql"
)

Expand Down
14 changes: 7 additions & 7 deletions server/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,20 @@ type conntainer struct {

// Handler is a connection handler for a SQLe engine.
type Handler struct {
mu sync.Mutex
e *sqle.Engine
sm *SessionManager
c map[uint32]conntainer
mu sync.Mutex
e *sqle.Engine
sm *SessionManager
c map[uint32]conntainer
readTimeout time.Duration
lc []*net.Conn
}

// NewHandler creates a new Handler given a SQLe engine.
func NewHandler(e *sqle.Engine, sm *SessionManager, rt time.Duration) *Handler {
return &Handler{
e: e,
sm: sm,
c: make(map[uint32]conntainer),
e: e,
sm: sm,
c: make(map[uint32]conntainer),
readTimeout: rt,
}
}
Expand Down
7 changes: 3 additions & 4 deletions server/handler_linux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package server

import (
"fmt"
"net"
"testing"

"github.com/opentracing/opentracing-go"
"github.com/src-d/go-mysql-server/sql"
"github.com/stretchr/testify/require"
"net"
"testing"
"vitess.io/vitess/go/sqltypes"
)

Expand Down Expand Up @@ -49,5 +50,3 @@ func TestBrokenConnection(t *testing.T) {
})
require.EqualError(err, "connection was closed")
}


7 changes: 4 additions & 3 deletions server/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ package server

import (
"fmt"
sqle "github.com/src-d/go-mysql-server"
"github.com/src-d/go-mysql-server/sql"
"net"
"testing"
"time"

sqle "github.com/src-d/go-mysql-server"
"github.com/src-d/go-mysql-server/sql"

"vitess.io/vitess/go/mysql"
"vitess.io/vitess/go/sqltypes"
"vitess.io/vitess/go/vt/proto/query"
Expand Down Expand Up @@ -284,7 +285,7 @@ func TestOkClosedConnection(t *testing.T) {
c2 := newConn(2)
h.NewConnection(c2)

q := fmt.Sprintf("SELECT SLEEP(%d)", tcpCheckerSleepTime * 4)
q := fmt.Sprintf("SELECT SLEEP(%d)", tcpCheckerSleepTime*4)
err = h.ComQuery(c2, q, func(res *sqltypes.Result) error {
return nil
})
Expand Down
2 changes: 1 addition & 1 deletion sql/analyzer/aggregations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package analyzer
import (
"testing"

"github.com/stretchr/testify/require"
"github.com/src-d/go-mysql-server/memory"
"github.com/src-d/go-mysql-server/sql"
"github.com/src-d/go-mysql-server/sql/expression"
"github.com/src-d/go-mysql-server/sql/expression/function/aggregation"
"github.com/src-d/go-mysql-server/sql/plan"
"github.com/stretchr/testify/require"
)

func TestReorderAggregations(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion sql/analyzer/analyzer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import (
"fmt"
"testing"

"github.com/stretchr/testify/require"
"github.com/src-d/go-mysql-server/memory"
"github.com/src-d/go-mysql-server/sql"
"github.com/src-d/go-mysql-server/sql/expression"
"github.com/src-d/go-mysql-server/sql/plan"
"github.com/stretchr/testify/require"
)

func TestAnalyzer_Analyze(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion sql/analyzer/assign_catalog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package analyzer
import (
"testing"

"github.com/stretchr/testify/require"
"github.com/src-d/go-mysql-server/memory"
"github.com/src-d/go-mysql-server/sql"
"github.com/src-d/go-mysql-server/sql/plan"
"github.com/stretchr/testify/require"
)

func TestAssignCatalog(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion sql/analyzer/assign_indexes.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package analyzer
import (
"reflect"

errors "gopkg.in/src-d/go-errors.v1"
"github.com/src-d/go-mysql-server/sql"
"github.com/src-d/go-mysql-server/sql/expression"
"github.com/src-d/go-mysql-server/sql/plan"
errors "gopkg.in/src-d/go-errors.v1"
)

var errInvalidInRightEvaluation = errors.NewKind("expecting evaluation of IN expression right hand side to be a tuple, but it is %T")
Expand Down
2 changes: 1 addition & 1 deletion sql/analyzer/assign_indexes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import (
"strings"
"testing"

"github.com/stretchr/testify/require"
"github.com/src-d/go-mysql-server/memory"
"github.com/src-d/go-mysql-server/sql"
"github.com/src-d/go-mysql-server/sql/expression"
"github.com/src-d/go-mysql-server/sql/plan"
"github.com/stretchr/testify/require"
)

func TestNegateIndex(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion sql/analyzer/filters_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package analyzer
import (
"testing"

"github.com/stretchr/testify/require"
"github.com/src-d/go-mysql-server/sql"
"github.com/src-d/go-mysql-server/sql/expression"
"github.com/stretchr/testify/require"
)

func TestFiltersMerge(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion sql/analyzer/optimization_rules_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package analyzer
import (
"testing"

"github.com/stretchr/testify/require"
"github.com/src-d/go-mysql-server/memory"
"github.com/src-d/go-mysql-server/sql"
"github.com/src-d/go-mysql-server/sql/expression"
"github.com/src-d/go-mysql-server/sql/plan"
"github.com/stretchr/testify/require"
)

func TestReorderProjection(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion sql/analyzer/process_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import (
"testing"
"time"

"github.com/stretchr/testify/require"
"github.com/src-d/go-mysql-server/memory"
"github.com/src-d/go-mysql-server/sql"
"github.com/src-d/go-mysql-server/sql/expression"
"github.com/src-d/go-mysql-server/sql/plan"
"github.com/stretchr/testify/require"
)

func TestTrackProcess(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion sql/analyzer/prune_columns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package analyzer
import (
"testing"

"github.com/stretchr/testify/require"
"github.com/src-d/go-mysql-server/memory"
"github.com/src-d/go-mysql-server/sql"
"github.com/src-d/go-mysql-server/sql/expression"
"github.com/src-d/go-mysql-server/sql/plan"
"github.com/stretchr/testify/require"
)

func TestPruneColumns(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion sql/analyzer/resolve_columns_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import (
"context"
"testing"

"github.com/stretchr/testify/require"
"github.com/src-d/go-mysql-server/memory"
"github.com/src-d/go-mysql-server/sql"
"github.com/src-d/go-mysql-server/sql/expression"
"github.com/src-d/go-mysql-server/sql/plan"
"github.com/stretchr/testify/require"
)

func TestQualifyColumnsProject(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions sql/analyzer/resolve_generators_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ package analyzer
import (
"testing"

"github.com/stretchr/testify/require"
"gopkg.in/src-d/go-errors.v1"
"github.com/src-d/go-mysql-server/sql"
"github.com/src-d/go-mysql-server/sql/expression"
"github.com/src-d/go-mysql-server/sql/expression/function"
"github.com/src-d/go-mysql-server/sql/plan"
"github.com/stretchr/testify/require"
"gopkg.in/src-d/go-errors.v1"
)

func TestResolveGenerators(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion sql/analyzer/resolve_natural_joins_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package analyzer
import (
"testing"

"github.com/stretchr/testify/require"
"github.com/src-d/go-mysql-server/memory"
"github.com/src-d/go-mysql-server/sql"
"github.com/src-d/go-mysql-server/sql/expression"
"github.com/src-d/go-mysql-server/sql/plan"
"github.com/stretchr/testify/require"
)

func TestResolveNaturalJoins(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion sql/analyzer/resolve_orderby_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package analyzer
import (
"testing"

"github.com/stretchr/testify/require"
"github.com/src-d/go-mysql-server/memory"
"github.com/src-d/go-mysql-server/sql"
"github.com/src-d/go-mysql-server/sql/expression"
"github.com/src-d/go-mysql-server/sql/plan"
"github.com/stretchr/testify/require"
)

func TestResolveOrderBy(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion sql/analyzer/resolve_stars_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package analyzer
import (
"testing"

"github.com/stretchr/testify/require"
"github.com/src-d/go-mysql-server/memory"
"github.com/src-d/go-mysql-server/sql"
"github.com/src-d/go-mysql-server/sql/expression"
"github.com/src-d/go-mysql-server/sql/plan"
"github.com/stretchr/testify/require"
)

func TestResolveStar(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion sql/analyzer/resolve_subqueries_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package analyzer
import (
"testing"

"github.com/stretchr/testify/require"
"github.com/src-d/go-mysql-server/memory"
"github.com/src-d/go-mysql-server/sql"
"github.com/src-d/go-mysql-server/sql/expression"
"github.com/src-d/go-mysql-server/sql/plan"
"github.com/stretchr/testify/require"
)

func TestResolveSubqueries(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion sql/analyzer/resolve_tables_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package analyzer
import (
"testing"

"github.com/stretchr/testify/require"
"github.com/src-d/go-mysql-server/memory"
"github.com/src-d/go-mysql-server/sql"
"github.com/src-d/go-mysql-server/sql/expression"
"github.com/src-d/go-mysql-server/sql/plan"
"github.com/stretchr/testify/require"
)

func TestResolveTables(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion sql/catalog_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package sql_test
import (
"testing"

"github.com/stretchr/testify/require"
"github.com/src-d/go-mysql-server/memory"
"github.com/src-d/go-mysql-server/sql"
"github.com/stretchr/testify/require"
)

func TestCatalogCurrentDatabase(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion sql/expression/arithmetic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"testing"
"time"

"github.com/stretchr/testify/require"
"github.com/src-d/go-mysql-server/sql"
"github.com/stretchr/testify/require"
)

func TestPlus(t *testing.T) {
Expand Down
Loading

0 comments on commit 6aa453e

Please sign in to comment.