first commit

This commit is contained in:
Yangtao
2025-11-18 17:48:20 +08:00
commit 6e56cab848
196 changed files with 65809 additions and 0 deletions

View File

@ -0,0 +1,30 @@
package HyTools
import (
"bytes"
"encoding/json"
"fmt"
)
type StringBuilder struct {
buf bytes.Buffer
}
func NewStringBuilder() *StringBuilder {
return &StringBuilder{buf: bytes.Buffer{}}
}
func (this *StringBuilder) Append(obj interface{}) *StringBuilder {
this.buf.WriteString(fmt.Sprintf("%v", obj))
return this
}
func (this *StringBuilder) ToString() string {
return this.buf.String()
}
// 字符串转int32
func JsonStr(v interface{}) string {
bys, _ := json.Marshal(v)
return string(bys)
}