docs: normalize & make basic corrections to documentation

This commit is contained in:
2025-08-01 21:19:47 -05:00
parent e13fd6ab5b
commit 292879a8a9
28 changed files with 132 additions and 229 deletions

View File

@@ -8,11 +8,11 @@ import (
"github.com/dromara/carbon/v2"
)
// Parses a HH:MM string.
// ParseTime parses a HH:MM string.
func ParseTime(s string) *carbon.Carbon {
t, err := time.Parse("15:04", s)
if err != nil {
parsingErr := fmt.Errorf("failed to parse time string \"%s\"; format must be HH:MM.: %w", s, err)
parsingErr := fmt.Errorf("failed to parse time string \"%s\"; format must be HH:MM: %w", s, err)
slog.Error(parsingErr.Error())
panic(parsingErr)
}
@@ -22,7 +22,7 @@ func ParseTime(s string) *carbon.Carbon {
func ParseDuration(s string) time.Duration {
d, err := time.ParseDuration(s)
if err != nil {
parsingErr := fmt.Errorf("couldn't parse string duration: \"%s\" see https://pkg.go.dev/time#ParseDuration for valid time units: %w", s, err)
parsingErr := fmt.Errorf("couldn't parse string duration: \"%s\"; see https://pkg.go.dev/time#ParseDuration for valid time units: %w", s, err)
slog.Error(parsingErr.Error())
panic(parsingErr)
}