[ga-format-pr] Run go/utils/repofmt/format_repo.sh and go/Godeps/update.sh

This commit is contained in:
zachmu
2022-05-24 21:41:24 +00:00
parent d46920ef37
commit 72b67b575a
6 changed files with 33 additions and 33 deletions

View File

@@ -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"
)

View File

@@ -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)
}

View File

@@ -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)

View File

@@ -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 {

View File

@@ -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")

View File

@@ -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")