Merge pull request 'fix typo' (#27) from parse into master
All checks were successful
Go Action / goaction (push) Successful in 42s

Reviewed-on: #27
This commit was merged in pull request #27.
This commit is contained in:
2025-12-30 21:57:21 +03:00
2 changed files with 9 additions and 9 deletions

View File

@@ -89,7 +89,7 @@ func JUnmarshal(b []byte, v any) error {
return nil return nil
} }
func JParce[T any](b []byte) (T, error) { func JParse[T any](b []byte) (T, error) {
var data T var data T
return data, JUnmarshal(b, &data) return data, JUnmarshal(b, &data)

View File

@@ -23,31 +23,31 @@ func (s JBytes) ParseString() (string, error) {
} }
func (s JBytes) ParseInt() (int, error) { func (s JBytes) ParseInt() (int, error) {
return JParce[int](s.Bytes()) return JParse[int](s.Bytes())
} }
func (s JBytes) ParseInt64() (int64, error) { func (s JBytes) ParseInt64() (int64, error) {
return JParce[int64](s.Bytes()) return JParse[int64](s.Bytes())
} }
func (s JBytes) ParseUint() (uint, error) { func (s JBytes) ParseUint() (uint, error) {
return JParce[uint](s.Bytes()) return JParse[uint](s.Bytes())
} }
func (s JBytes) ParseUint64() (uint64, error) { func (s JBytes) ParseUint64() (uint64, error) {
return JParce[uint64](s.Bytes()) return JParse[uint64](s.Bytes())
} }
func (s JBytes) ParseFloat64() (float64, error) { func (s JBytes) ParseFloat64() (float64, error) {
return JParce[float64](s.Bytes()) return JParse[float64](s.Bytes())
} }
func (s JBytes) ParseBool() (bool, error) { func (s JBytes) ParseBool() (bool, error) {
return JParce[bool](s.Bytes()) return JParse[bool](s.Bytes())
} }
func (s JBytes) ParseDuration() (time.Duration, error) { func (s JBytes) ParseDuration() (time.Duration, error) {
jdata, jerr := JParce[time.Duration](s.Bytes()) jdata, jerr := JParse[time.Duration](s.Bytes())
if jerr == nil { if jerr == nil {
return jdata, nil return jdata, nil
} }
@@ -61,7 +61,7 @@ func (s JBytes) ParseDuration() (time.Duration, error) {
} }
func (s JBytes) ParseTime() (time.Time, error) { func (s JBytes) ParseTime() (time.Time, error) {
return JParce[time.Time](s.Bytes()) return JParse[time.Time](s.Bytes())
} }
func (s JBytes) Bytes() []byte { func (s JBytes) Bytes() []byte {