From 72b67b575aa8d2cc27f9e1eb378f3ce5c8ee86ce Mon Sep 17 00:00:00 2001 From: zachmu Date: Tue, 24 May 2022 21:41:24 +0000 Subject: [PATCH] [ga-format-pr] Run go/utils/repofmt/format_repo.sh and go/Godeps/update.sh --- go/libraries/doltcore/doltdb/durable/table.go | 2 +- .../doltcore/sqle/alterschema_test.go | 26 +++++++++---------- go/libraries/doltcore/sqle/tables.go | 8 +++--- .../sqle/writer/prolly_table_writer.go | 2 +- go/store/cmd/noms/noms_show.go | 10 +++---- go/store/types/serial_message.go | 18 ++++++------- 6 files changed, 33 insertions(+), 33 deletions(-) diff --git a/go/libraries/doltcore/doltdb/durable/table.go b/go/libraries/doltcore/doltdb/durable/table.go index c695290fbc..0290dcac1e 100644 --- a/go/libraries/doltcore/doltdb/durable/table.go +++ b/go/libraries/doltcore/doltdb/durable/table.go @@ -20,7 +20,6 @@ import ( "errors" "fmt" - "github.com/dolthub/dolt/go/store/prolly/tree" flatbuffers "github.com/google/flatbuffers/go" "github.com/dolthub/dolt/go/gen/fb/serial" @@ -32,6 +31,7 @@ import ( "github.com/dolthub/dolt/go/store/hash" "github.com/dolthub/dolt/go/store/pool" "github.com/dolthub/dolt/go/store/prolly" + "github.com/dolthub/dolt/go/store/prolly/tree" "github.com/dolthub/dolt/go/store/types" ) diff --git a/go/libraries/doltcore/sqle/alterschema_test.go b/go/libraries/doltcore/sqle/alterschema_test.go index 99dd586d3f..2265d6314b 100755 --- a/go/libraries/doltcore/sqle/alterschema_test.go +++ b/go/libraries/doltcore/sqle/alterschema_test.go @@ -446,10 +446,10 @@ func TestDropColumnUsedByIndex(t *testing.T) { func TestDropPks(t *testing.T) { var dropTests = []struct { - name string - setup []string - expectedErr *errors.Kind - fkIdxName string + name string + setup []string + expectedErr *errors.Kind + fkIdxName string }{ { name: "no error on drop pk", @@ -536,8 +536,8 @@ func TestDropPks(t *testing.T) { "create table parent (id int, name varchar(1), age int, primary key (id))", "create table child (id int, name varchar(1), age int, primary key (id), constraint `fk` foreign key (id) references parent (id))", }, - expectedErr: sql.ErrCantDropIndex, - fkIdxName: "id", + expectedErr: sql.ErrCantDropIndex, + fkIdxName: "id", }, { name: "error if FK ref but bad backup index", @@ -545,8 +545,8 @@ func TestDropPks(t *testing.T) { "create table parent (id int, name varchar(1), age int, primary key (id), key `bad_backup2` (age))", "create table child (id int, name varchar(1), age int, constraint `fk` foreign key (id) references parent (id))", }, - expectedErr: sql.ErrCantDropIndex, - fkIdxName: "id", + expectedErr: sql.ErrCantDropIndex, + fkIdxName: "id", }, { name: "error if misordered compound backup index for FK", @@ -554,8 +554,8 @@ func TestDropPks(t *testing.T) { "create table parent (id int, name varchar(1), age int, constraint `primary` primary key (id), key `backup` (age, id))", "create table child (id int, name varchar(1), age int, constraint `fk` foreign key (id) references parent (id))", }, - expectedErr: sql.ErrCantDropIndex, - fkIdxName: "id", + expectedErr: sql.ErrCantDropIndex, + fkIdxName: "id", }, { name: "error if incomplete compound backup index for FK", @@ -563,8 +563,8 @@ func TestDropPks(t *testing.T) { "create table parent (id int, name varchar(1), age int, constraint `primary` primary key (age, id), key `backup` (age, name))", "create table child (id int, name varchar(1), age int, constraint `fk` foreign key (age, id) references parent (age, id))", }, - expectedErr: sql.ErrCantDropIndex, - fkIdxName: "ageid", + expectedErr: sql.ErrCantDropIndex, + fkIdxName: "ageid", }, } @@ -765,7 +765,7 @@ func TestNewPkOrdinals(t *testing.T) { t.Run(tt.name, func(t *testing.T) { res, err := modifyPkOrdinals(oldSch, tt.newSch) if tt.err != nil { - require.True(t, goerrors.Is(err, tt.err)) + require.True(t, goerrors.Is(err, tt.err)) } else { require.Equal(t, res, tt.expPkOrdinals) } diff --git a/go/libraries/doltcore/sqle/tables.go b/go/libraries/doltcore/sqle/tables.go index ff1e8638db..19d2969a24 100644 --- a/go/libraries/doltcore/sqle/tables.go +++ b/go/libraries/doltcore/sqle/tables.go @@ -967,10 +967,10 @@ func (t *AlterableDoltTable) ShouldRewriteTable( } func (t *AlterableDoltTable) RewriteInserter( - ctx *sql.Context, - oldSchema sql.PrimaryKeySchema, - newSchema sql.PrimaryKeySchema, - modifiedColumn *sql.Column, + ctx *sql.Context, + oldSchema sql.PrimaryKeySchema, + newSchema sql.PrimaryKeySchema, + modifiedColumn *sql.Column, ) (sql.RowInserter, error) { sess := dsess.DSessFromSess(ctx.Session) diff --git a/go/libraries/doltcore/sqle/writer/prolly_table_writer.go b/go/libraries/doltcore/sqle/writer/prolly_table_writer.go index 0f7a41897c..984e4d58bc 100644 --- a/go/libraries/doltcore/sqle/writer/prolly_table_writer.go +++ b/go/libraries/doltcore/sqle/writer/prolly_table_writer.go @@ -245,7 +245,7 @@ func (w *prollyTableWriter) Reset(ctx context.Context, sess *prollyWriteSession, aiCol := autoIncrementColFromSchema(sch) var newPrimary indexWriter -var newSecondaries []indexWriter + var newSecondaries []indexWriter if schema.IsKeyless(sch) { newPrimary, err = getPrimaryKeylessProllyWriter(ctx, tbl, sqlSch.Schema, sch) if err != nil { diff --git a/go/store/cmd/noms/noms_show.go b/go/store/cmd/noms/noms_show.go index 62e126bca4..6e6023a17f 100644 --- a/go/store/cmd/noms/noms_show.go +++ b/go/store/cmd/noms/noms_show.go @@ -29,12 +29,12 @@ import ( "os" "strings" - "github.com/dolthub/dolt/go/gen/fb/serial" - "github.com/dolthub/dolt/go/store/hash" flag "github.com/juju/gnuflag" + "github.com/dolthub/dolt/go/gen/fb/serial" "github.com/dolthub/dolt/go/store/cmd/noms/util" "github.com/dolthub/dolt/go/store/config" + "github.com/dolthub/dolt/go/store/hash" "github.com/dolthub/dolt/go/store/prolly" "github.com/dolthub/dolt/go/store/prolly/tree" "github.com/dolthub/dolt/go/store/types" @@ -192,8 +192,8 @@ func outputEncodedValue(ctx context.Context, w io.Writer, value interface{}) err msg := serial.GetRootAsTable(value, 0) fmt.Fprintf(w, "{\n") - fmt.Fprintf(w, "\tSchema: #%s\n", hash.New(msg.SchemaBytes()).String()) - fmt.Fprintf(w, "\tViolations: #%s\n", hash.New(msg.ViolationsBytes()).String()) + fmt.Fprintf(w, "\tSchema: #%s\n", hash.New(msg.SchemaBytes()).String()) + fmt.Fprintf(w, "\tViolations: #%s\n", hash.New(msg.ViolationsBytes()).String()) // TODO: merge conflicts, not stable yet fmt.Fprintf(w, "\tAutoinc: %d\n", msg.AutoIncrementValue()) @@ -208,7 +208,7 @@ func outputEncodedValue(ctx context.Context, w io.Writer, value interface{}) err hashes := idxRefs.RefArrayBytes() for i := 0; i < idxRefs.NamesLength(); i++ { name := idxRefs.Names(i) - addr := hash.New(hashes[i*20:(i+1)*20]) + addr := hash.New(hashes[i*20 : (i+1)*20]) fmt.Fprintf(w, "\t\t%s: #%s\n", name, addr.String()) } fmt.Fprintf(w, "\t}\n") diff --git a/go/store/types/serial_message.go b/go/store/types/serial_message.go index 7ecdb3c436..6d7de572d9 100644 --- a/go/store/types/serial_message.go +++ b/go/store/types/serial_message.go @@ -61,7 +61,7 @@ func (sm SerialMessage) HumanReadableString() string { hashes := refs.RefArrayBytes() for i := 0; i < refs.NamesLength(); i++ { name := refs.Names(i) - addr := hash.New(hashes[i*20:(i+1)*20]) + addr := hash.New(hashes[i*20 : (i+1)*20]) fmt.Fprintf(ret, "\t%s: #%s\n", name, addr.String()) } fmt.Fprintf(ret, "}") @@ -92,16 +92,16 @@ func (sm SerialMessage) HumanReadableString() string { fmt.Fprintf(ret, "\tParents: {\n") hashes := msg.ParentAddrsBytes() - for i := 0; i < msg.ParentAddrsLength() / hash.ByteLen; i++ { - addr := hash.New(hashes[i*20:(i+1)*20]) + for i := 0; i < msg.ParentAddrsLength()/hash.ByteLen; i++ { + addr := hash.New(hashes[i*20 : (i+1)*20]) fmt.Fprintf(ret, "\t\t#%s\n", addr.String()) } fmt.Fprintf(ret, "\t}\n") fmt.Fprintf(ret, "\tParentClosure: {\n") hashes = msg.ParentClosureBytes() - for i := 0; i < msg.ParentClosureLength() / hash.ByteLen; i++ { - addr := hash.New(hashes[i*20:(i+1)*20]) + for i := 0; i < msg.ParentClosureLength()/hash.ByteLen; i++ { + addr := hash.New(hashes[i*20 : (i+1)*20]) fmt.Fprintf(ret, "\t\t#%s\n", addr.String()) } fmt.Fprintf(ret, "\t}\n") @@ -120,7 +120,7 @@ func (sm SerialMessage) HumanReadableString() string { hashes := tableRefs.RefArrayBytes() for i := 0; i < tableRefs.NamesLength(); i++ { name := tableRefs.Names(i) - addr := hash.New(hashes[i*20:(i+1)*20]) + addr := hash.New(hashes[i*20 : (i+1)*20]) fmt.Fprintf(ret, "\t\t%s: #%s\n", name, addr.String()) } fmt.Fprintf(ret, "\t}\n") @@ -131,8 +131,8 @@ func (sm SerialMessage) HumanReadableString() string { ret := &strings.Builder{} fmt.Fprintf(ret, "{\n") - fmt.Fprintf(ret, "\tSchema: #%s\n", hash.New(msg.SchemaBytes()).String()) - fmt.Fprintf(ret, "\tViolations: #%s\n", hash.New(msg.ViolationsBytes()).String()) + fmt.Fprintf(ret, "\tSchema: #%s\n", hash.New(msg.SchemaBytes()).String()) + fmt.Fprintf(ret, "\tViolations: #%s\n", hash.New(msg.ViolationsBytes()).String()) // TODO: merge conflicts, not stable yet fmt.Fprintf(ret, "\tAutoinc: %d\n", msg.AutoIncrementValue()) @@ -145,7 +145,7 @@ func (sm SerialMessage) HumanReadableString() string { hashes := idxRefs.RefArrayBytes() for i := 0; i < idxRefs.NamesLength(); i++ { name := idxRefs.Names(i) - addr := hash.New(hashes[i*20:(i+1)*20]) + addr := hash.New(hashes[i*20 : (i+1)*20]) fmt.Fprintf(ret, "\t\t%s: #%s\n", name, addr.String()) } fmt.Fprintf(ret, "\t}\n")