Skip to content

Commit f94d178

Browse files
authored
perf(command): use b2s instead of string(bytes) (#32)
1 parent 84151e4 commit f94d178

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

cmd/cz/cz.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"errors"
55
"fmt"
66

7+
"github.com/shipengqi/golib/convutil"
78
"github.com/spf13/cobra"
89

910
"github.com/shipengqi/commitizen/internal/config"
@@ -37,7 +38,7 @@ func New() *cobra.Command {
3738
}
3839

3940
if o.DryRun {
40-
fmt.Println(string(msg))
41+
fmt.Println(convutil.B2S(msg))
4142
return nil
4243
}
4344
output, err := git.Commit(msg, o.GitOptions)

internal/git/git.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ func WorkingTreeRoot() (path string, err error) {
4141
if err != nil {
4242
return "", err
4343
}
44-
return strings.TrimSpace(string(output)), nil
44+
return strings.TrimSpace(output), nil
4545
}
4646

4747
func ExecPath() (string, error) {

0 commit comments

Comments
 (0)