From b0cd6828b2278839cc772864167633daf9d49d12 Mon Sep 17 00:00:00 2001 From: Aaron L Date: Sun, 14 Aug 2016 00:20:34 -0700 Subject: [PATCH] Delete swaths of unused code --- bdb/column.go | 10 ---------- bdb/keys.go | 11 ----------- bdb/keys_test.go | 20 -------------------- templates.go | 2 -- 4 files changed, 43 deletions(-) diff --git a/bdb/column.go b/bdb/column.go index d436525..688bd95 100644 --- a/bdb/column.go +++ b/bdb/column.go @@ -24,16 +24,6 @@ func ColumnNames(cols []Column) []string { return names } -// ColumnTypes of the columns. -func ColumnTypes(cols []Column) []string { - types := make([]string, len(cols)) - for i, c := range cols { - types[i] = c.Type - } - - return types -} - // ColumnDBTypes of the columns. func ColumnDBTypes(cols []Column) map[string]string { types := map[string]string{} diff --git a/bdb/keys.go b/bdb/keys.go index 6efe324..21f9dff 100644 --- a/bdb/keys.go +++ b/bdb/keys.go @@ -78,14 +78,3 @@ func SQLColDefinitions(cols []Column, names []string) SQLColumnDefs { return ret } - -// SQLColDefStrings turns SQLColumnDefs into strings. -func SQLColDefStrings(defs []SQLColumnDef) []string { - strs := make([]string, len(defs)) - - for i, d := range defs { - strs[i] = d.String() - } - - return strs -} diff --git a/bdb/keys_test.go b/bdb/keys_test.go index 45948b5..3135128 100644 --- a/bdb/keys_test.go +++ b/bdb/keys_test.go @@ -30,23 +30,3 @@ func TestSQLColDefinitions(t *testing.T) { t.Error("wrong def:", got) } } - -func TestSQLDefStrings(t *testing.T) { - t.Parallel() - - cols := []Column{ - {Name: "one", Type: "int64"}, - {Name: "two", Type: "string"}, - {Name: "three", Type: "string"}, - } - - defs := SQLColDefinitions(cols, []string{"one", "three"}) - strs := SQLColDefStrings(defs) - - if got := strs[0]; got != "one int64" { - t.Error("wrong str:", got) - } - if got := strs[1]; got != "three string" { - t.Error("wrong str:", got) - } -} diff --git a/templates.go b/templates.go index b7e558e..2f736d6 100644 --- a/templates.go +++ b/templates.go @@ -171,8 +171,6 @@ var templateFunctions = template.FuncMap{ // dbdrivers ops "filterColumnsByDefault": bdb.FilterColumnsByDefault, "sqlColDefinitions": bdb.SQLColDefinitions, - "sqlColDefStrings": bdb.SQLColDefStrings, "columnNames": bdb.ColumnNames, - "columnTypes": bdb.ColumnTypes, "columnDBTypes": bdb.ColumnDBTypes, }