Skip to content

Commit 9ef6bd0

Browse files
committed
📝 doc: re-generate new README and fix some code style
1 parent 3ace818 commit 9ef6bd0

File tree

5 files changed

+7
-20
lines changed

5 files changed

+7
-20
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -945,6 +945,7 @@ func MaxFloat(x, y float64) float64
945945
// source at mathutil/convert.go
946946
func NewConvOption[T any](optFns ...ConvOptionFn[T]) *ConvOption[T]
947947
func WithNilAsFail[T any](opt *ConvOption[T])
948+
func WithHandlePtr[T any](opt *ConvOption[T])
948949
func WithUserConvFn[T any](fn ToTypeFunc[T]) ConvOptionFn[T]
949950
func Int(in any) (int, error)
950951
func SafeInt(in any) int

README.zh-CN.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -946,6 +946,7 @@ func MaxFloat(x, y float64) float64
946946
// source at mathutil/convert.go
947947
func NewConvOption[T any](optFns ...ConvOptionFn[T]) *ConvOption[T]
948948
func WithNilAsFail[T any](opt *ConvOption[T])
949+
func WithHandlePtr[T any](opt *ConvOption[T])
949950
func WithUserConvFn[T any](fn ToTypeFunc[T]) ConvOptionFn[T]
950951
func Int(in any) (int, error)
951952
func SafeInt(in any) int

fsutil/opwrite.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,17 @@ func TempDir(dir, pattern string) (string, error) {
5757

5858
// MustSave create file and write contents to file, panic on error.
5959
//
60-
// data type allow: string, []byte, io.Reader
60+
// - data type allow: string, []byte, io.Reader
61+
//
6162
// default option see NewOpenOption()
6263
func MustSave(filePath string, data any, optFns ...OpenOptionFunc) {
6364
basefn.MustOK(SaveFile(filePath, data, optFns...))
6465
}
6566

6667
// SaveFile create file and write contents to file. will auto create dir.
6768
//
69+
// - data type allow: string, []byte, io.Reader
70+
//
6871
// default option see NewOpenOption()
6972
func SaveFile(filePath string, data any, optFns ...OpenOptionFunc) error {
7073
opt := NewOpenOption(optFns...)

reflects/reflects.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
package reflects
33

44
import (
5-
"fmt"
65
"reflect"
76
)
87

@@ -12,6 +11,6 @@ var (
1211
anyType = reflect.TypeOf((*any)(nil)).Elem()
1312
errorType = reflect.TypeOf((*error)(nil)).Elem()
1413

15-
fmtStringerType = reflect.TypeOf((*fmt.Stringer)(nil)).Elem()
14+
// fmtStringerType = reflect.TypeOf((*fmt.Stringer)(nil)).Elem()
1615
reflectValueType = reflect.TypeOf((*reflect.Value)(nil)).Elem()
1716
)

strutil/strutil.go

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55
"errors"
66
"fmt"
77
"strings"
8-
"text/template"
98

109
"github.com/gookit/goutil/comdef"
1110
)
@@ -90,22 +89,6 @@ func NewReplacer(pairs map[string]string) *strings.Replacer {
9089
return strings.NewReplacer(ss...)
9190
}
9291

93-
var builtInFuncs = template.FuncMap{
94-
// don't escape content
95-
"raw": func(s string) string {
96-
return s
97-
},
98-
"trim": strings.TrimSpace,
99-
// join strings
100-
"join": func(ss []string, sep string) string {
101-
return strings.Join(ss, sep)
102-
},
103-
// lower first char
104-
"lcFirst": LowerFirst,
105-
// upper first char
106-
"upFirst": UpperFirst,
107-
}
108-
10992
// WrapTag for given string.
11093
func WrapTag(s, tag string) string {
11194
if s == "" {

0 commit comments

Comments
 (0)