From e121fd01eabeb7562ed4aa5b4a2b3a8fcea97bf2 Mon Sep 17 00:00:00 2001 From: mahdi Date: Fri, 3 Nov 2023 02:09:33 +0100 Subject: [PATCH] amend --- config/go.mod | 2 ++ config/go.sum | 4 ++++ config/loader.go | 5 +++++ util/util.go | 4 ++-- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/config/go.mod b/config/go.mod index 0d687b9..d0c3086 100644 --- a/config/go.mod +++ b/config/go.mod @@ -4,6 +4,8 @@ go 1.20 require ( gitea.meta-tech.academy/go/core/sys v0.0.0-20231103003446-3792c0f48134 + gitea.meta-tech.academy/go/core/test v0.0.0-20231103010311-6108435b4311 + gitea.meta-tech.academy/go/core/util v0.0.0-20231103010311-6108435b4311 gopkg.in/yaml.v3 v3.0.1 ) diff --git a/config/go.sum b/config/go.sum index e4ef0d7..a76c916 100644 --- a/config/go.sum +++ b/config/go.sum @@ -1,5 +1,9 @@ gitea.meta-tech.academy/go/core/sys v0.0.0-20231103003446-3792c0f48134 h1:2r+IHzl0IS3yQIsBDU41+XeB+QOK95io55DdAGgij48= gitea.meta-tech.academy/go/core/sys v0.0.0-20231103003446-3792c0f48134/go.mod h1:7GvZIAuk/3KbVMt8dTI+HFDtiEvk5OrtMrf6TUPAqwc= +gitea.meta-tech.academy/go/core/test v0.0.0-20231103010311-6108435b4311 h1:TPoKjY01UVOLjyRPZTUsXzwpjCMbadv/XgP9Wb7xrt4= +gitea.meta-tech.academy/go/core/test v0.0.0-20231103010311-6108435b4311/go.mod h1:IxtIf0ZnyckLaYvhE1tNEiSqoehb+iA6g1+BPcSYwz8= +gitea.meta-tech.academy/go/core/util v0.0.0-20231103010311-6108435b4311 h1:QsFN577qrxVIYJal35IpGZVKDxQO0VVm/jf3PvbCfN0= +gitea.meta-tech.academy/go/core/util v0.0.0-20231103010311-6108435b4311/go.mod h1:q+p8vM+aQ36GVspuTTupRBNDUKrsXCccx4k3f7IKfx8= golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= diff --git a/config/loader.go b/config/loader.go index d32160a..2b145d0 100644 --- a/config/loader.go +++ b/config/loader.go @@ -8,6 +8,7 @@ import ( "gitea.meta-tech.academy/go/core/sys" "gitea.meta-tech.academy/go/core/test" + "gitea.meta-tech.academy/go/core/util" "gopkg.in/yaml.v3" ) @@ -19,6 +20,10 @@ func tata() { test.Test() } +func titi() { + util.Str2int("456") +} + type Cfg interface { GetVar() []VarConfig } diff --git a/util/util.go b/util/util.go index d67c800..0352940 100644 --- a/util/util.go +++ b/util/util.go @@ -27,13 +27,13 @@ func Str2int64(str string, base int, fallback int64) int64 { } func Str2int(str string, base int, fallback int) int { - return int(str2int64(str, base, int64(fallback))) + return int(Str2int64(str, base, int64(fallback))) } func CastStrings2ints(strs *[]string) []int { a := make([]int, len(*strs)) for i, elm := range *strs { - var f int = str2int(elm, 10, 0) + var f int = Str2int(elm, 10, 0) a[i] = f } return a