优化从文件读取

This commit is contained in:
Yun
2024-07-10 17:24:58 +08:00
parent 3e2c5daf3e
commit 9d844ed7d4
7 changed files with 97 additions and 4 deletions
+2 -1
View File
@@ -18,6 +18,7 @@ func defaultOptions() *options {
type Option func(*options)
// 设置默认的code
func SetDefaultCode(code int) Option {
return func(o *options) {
o.defaultCode = code
@@ -38,7 +39,7 @@ func SetDefaultLanguage(lang string) Option {
}
}
// 替换规则 %s 为占位符
// 替换规则 %s 为占位符 需要填进去
func SetReplaceKey(key string) Option {
return func(o *options) {
o.replaceKey = key