Skip to content

Commit

Permalink
⚡ Use strings.Builder instead of bytes.Buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
gabe565 committed Mar 11, 2022
1 parent e358753 commit 253965a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/dump/generate_filename.go
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package dump

import (
"bytes"
"fmt"
"github.com/clevyr/kubedb/internal/database/sqlformat"
"path/filepath"
"strings"
"text/template"
"time"
)
Expand Down Expand Up @@ -39,13 +39,13 @@ func (vars Filename) Generate() (string, error) {
return "", err
}

var tpl bytes.Buffer
err = t.Execute(&tpl, vars)
var buf strings.Builder
err = t.Execute(&buf, vars)
if err != nil {
return "", err
}

return filepath.Join(vars.Dir, tpl.String()), nil
return filepath.Join(vars.Dir, buf.String()), nil
}

func HelpFilename() string {
Expand Down

0 comments on commit 253965a

Please sign in to comment.