|
|
@@ -18,9 +18,9 @@ type KTxt struct {
|
|
|
|
|
|
// Txt -- создать новую строку.
|
|
|
func Txt[T def_spec.TxtConstraint](msg T, arg ...any) *KTxt {
|
|
|
- _msg := fmt.Sprintf(string(msg), arg...)
|
|
|
+ _msg := def_spec.Sprintf(msg, arg...)
|
|
|
sf := &KTxt{
|
|
|
- val: def_spec.ATxt(_msg),
|
|
|
+ val: _msg,
|
|
|
}
|
|
|
return sf
|
|
|
}
|
|
|
@@ -33,9 +33,9 @@ func TxtFix[T def_spec.TxtConstraint](msg T, arg ...any) def_spec.ITxtFix {
|
|
|
|
|
|
// TxtMut -- создать новую мутабельную строку.
|
|
|
func TxtMut[T def_spec.TxtConstraint](msg T, arg ...any) def_spec.ITxtMut {
|
|
|
- _msg := fmt.Sprintf(string(msg), arg...)
|
|
|
+ _msg := def_spec.Sprintf(msg, arg...)
|
|
|
sf := &KTxt{
|
|
|
- val: def_spec.ATxt(_msg),
|
|
|
+ val: _msg,
|
|
|
}
|
|
|
return sf
|
|
|
}
|
|
|
@@ -47,10 +47,9 @@ func (sf KTxt) Get() def_spec.ATxt {
|
|
|
|
|
|
// Concat -- создать новую строку.
|
|
|
func (sf *KTxt) Concat(msg any, arg ...any) def_spec.ITxtFix {
|
|
|
- val := fmt.Sprintf("%v", msg)
|
|
|
- val = fmt.Sprintf(val, arg...)
|
|
|
- _msg := string(sf.val) + val
|
|
|
- sf.val = def_spec.ATxt(_msg)
|
|
|
+ val := def_spec.Sprintf("%v", msg)
|
|
|
+ val = def_spec.Sprintf(val, arg...)
|
|
|
+ sf.val += val
|
|
|
return sf
|
|
|
}
|
|
|
|
|
|
@@ -86,11 +85,11 @@ func (sf KTxt) String() string {
|
|
|
return string(sf.val)
|
|
|
}
|
|
|
|
|
|
-// Atoi -- возвращает возможное число
|
|
|
+// Atoi -- возвращает возможное число.
|
|
|
func (sf KTxt) Atoi() def_spec.IResult[def_spec.Int] {
|
|
|
iRes,err:=strconv.Atoi(sf.String())
|
|
|
if err!=nil{
|
|
|
- err:=fmt.Errorf("KTxt.Atot(): val(%q) not int, err=\n\t%w", err)
|
|
|
+ err:=fmt.Errorf("KTxt.Atot(): val(%q) not int, err=\n\t%w", sf.val, err)
|
|
|
return result.NewErr[def_spec.Int](err)
|
|
|
}
|
|
|
return result.NewOk(def_spec.Int(iRes))
|