diff --git a/create.go b/create.go index 4ee2ad4..4ad4445 100644 --- a/create.go +++ b/create.go @@ -1,7 +1,6 @@ package bob import ( - "bytes" "errors" "strings" @@ -205,7 +204,7 @@ func (d *createData) ToSql() (sqlStr string, args []interface{}, err error) { return } - sql := &bytes.Buffer{} + var sql strings.Builder sql.WriteString("CREATE TABLE ") diff --git a/has.go b/has.go index d1d2e4c..7d515a5 100644 --- a/has.go +++ b/has.go @@ -1,8 +1,8 @@ package bob import ( - "bytes" "errors" + "strings" "github.com/lann/builder" ) @@ -50,7 +50,7 @@ func (h HasBuilder) ToSql() (string, []interface{}, error) { // ToSql returns 3 variables filled out with the correct values based on bindings, etc. func (d *hasData) ToSql() (sqlStr string, args []interface{}, err error) { - sql := &bytes.Buffer{} + var sql strings.Builder if d.Name == "" { err = errors.New("has statement should have a table name") return diff --git a/internal.go b/internal.go index 3d13aa4..b0855b5 100644 --- a/internal.go +++ b/internal.go @@ -14,21 +14,21 @@ func createArgs(keys ...interface{}) []interface{} { } // isIn checks if an array have a value -func isIn(arr []string, value string) bool { - for _, item := range arr { - if item == value { - return true - } - } - return false -} +// func isIn(arr []string, value string) bool { +// for _, item := range arr { +// if item == value { +// return true +// } +// } +// return false +// } -// findPosition search for value position on an array -func findPosition(arr []string, value string) int { - for i, item := range arr { - if item == value { - return i - } - } - return -1 -} +// // findPosition search for value position on an array +// func findPosition(arr []string, value string) int { +// for i, item := range arr { +// if item == value { +// return i +// } +// } +// return -1 +// } diff --git a/upsert.go b/upsert.go index 2fb19f2..58c2b0b 100644 --- a/upsert.go +++ b/upsert.go @@ -1,7 +1,6 @@ package bob import ( - "bytes" "errors" "strings" @@ -98,7 +97,7 @@ func (d *upsertData) ToSql() (sqlStr string, args []interface{}, err error) { return } - sql := &bytes.Buffer{} + var sql strings.Builder if d.Dialect == MSSQL { if len(d.Key) == 0 {