1 Star 0 Fork 60

amuluze / carbon

forked from golang-module / carbon 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
errors.go 1.38 KB
一键复制 编辑 原始数据 按行查看 历史
gouguoyin 提交于 2022-08-01 12:25 . v2.1.9 新增 SetLocation() 方法
package carbon
import (
"fmt"
)
// returns an invalid timezone error.
// 无效的时区错误
var invalidTimezoneError = func(timezone string) error {
return fmt.Errorf("invalid timezone %q, please see the file %q for all valid timezones", timezone, "$GOROOT/lib/time/zoneinfo.zip")
}
// returns an invalid location error.
// 无效的地区错误
var invalidLocationError = func() error {
return fmt.Errorf("invalid location, please make sure the location is valid")
}
// returns an invalid duration error.
// 无效的时长错误
var invalidDurationError = func(duration string) error {
return fmt.Errorf("invalid duration %q, please make sure the duration is valid", duration)
}
// returns an invalid value error.
// 无效的时间字符串错误
var invalidValueError = func(value string) error {
return fmt.Errorf("cannot parse %q as carbon, please make sure the value is valid", value)
}
// returns an invalid layout error.
// 无效的布局模板错误
var invalidLayoutError = func(value, layout string) error {
return fmt.Errorf("cannot parse %q as carbon by layout %q, please make sure the value and layout match", value, layout)
}
// returns an invalid format error.
// 无效的格式模板错误
var invalidFormatError = func(value, format string) error {
return fmt.Errorf("cannot parse %q as carbon by format %q, please make sure the value and format match", value, format)
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/amuluze/carbon.git
git@gitee.com:amuluze/carbon.git
amuluze
carbon
carbon
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891