From 89ec1cfdb733c23f4f4cc16edb2569d2f15aef58 Mon Sep 17 00:00:00 2001 From: Aaron L Date: Mon, 8 Aug 2016 11:03:46 -0700 Subject: [PATCH] Delete useless duplicate method. --- boil/helpers.go | 16 ---------------- boil/helpers_test.go | 16 ---------------- 2 files changed, 32 deletions(-) diff --git a/boil/helpers.go b/boil/helpers.go index ce3a3fa..7018865 100644 --- a/boil/helpers.go +++ b/boil/helpers.go @@ -197,22 +197,6 @@ func SelectNames(results interface{}) string { return strings.Join(names, ", ") } -// WhereClause returns the where clause for an sql statement -// eg: "col1"=$1 AND "col2"=$2 AND "col3"=$3 -func WhereClause(columns []string) string { - names := make([]string, 0, len(columns)) - - for _, c := range columns { - names = append(names, c) - } - - for i, c := range names { - names[i] = fmt.Sprintf(`"%s"=$%d`, c, i+1) - } - - return strings.Join(names, " AND ") -} - // Update returns the column list for an update statement SET clause // eg: "col1"=$1, "col2"=$2, "col3"=$3 func Update(columns map[string]interface{}) string { diff --git a/boil/helpers_test.go b/boil/helpers_test.go index d376569..414bf49 100644 --- a/boil/helpers_test.go +++ b/boil/helpers_test.go @@ -308,19 +308,3 @@ func TestSelectNames(t *testing.T) { t.Error("Result was wrong, got:", result) } } - -func TestWhereClause(t *testing.T) { - t.Parallel() - - columns := []string{ - "id", - "name", - "date", - } - - result := WhereClause(columns) - - if result != `"id"=$1 AND "name"=$2 AND "date"=$3` { - t.Error("Result was wrong, got:", result) - } -}