This commit is contained in:
Mahdi Abu Yasmine 2023-11-03 01:19:36 +01:00
parent 4e893e3b99
commit f8de6f01e7
19 changed files with 28 additions and 42 deletions

5
config/go.mod Normal file
View File

@ -0,0 +1,5 @@
module gitea.meta-tech.academy/core/config
go 1.20
require gopkg.in/yaml.v3 v3.0.1

3
go.mod
View File

@ -1,3 +0,0 @@
module gitea.meta-tech.academy/go/core
go 1.20

0
go.sum
View File

View File

@ -1,9 +1,8 @@
go 1.20 go 1.20
use ( use (
. ./config
./src/config ./style
./src/style ./sys
./src/sys ./util
./src/util
) )

View File

@ -1,9 +1,3 @@
gitea.meta-tech.academy/go/core/util v0.0.0-20231102220428-c719e245b956/go.mod h1:q+p8vM+aQ36GVspuTTupRBNDUKrsXCccx4k3f7IKfx8=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/gookit/color v1.5.4 h1:FZmqs7XOyGgCAxmWyPslpiok1k05wmY3SJTytgvYFs0=
github.com/gookit/color v1.5.4/go.mod h1:pZJOeOS8DM43rXbp4AZo1n9zCU2qjpcRko0b6/QJi9w=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 h1:QldyIu/L63oPpyvQmHgvgickp1Yw510KJOqX7H24mg8=
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs=
golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=

View File

@ -1,5 +0,0 @@
module gitea.meta-tech.academy/go/core/config
go 1.20
require gopkg.in/yaml.v3 v3.0.1

View File

@ -1,15 +0,0 @@
module gitea.meta-tech.academy/go/core/style
go 1.20
require (
gitea.meta-tech.academy/go/core/util v0.0.0
github.com/gookit/color v1.5.4
)
require (
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect
golang.org/x/sys v0.10.0 // indirect
)
replace gitea.meta-tech.academy/go/core/util v0.0.0 => ../util

View File

@ -1,3 +0,0 @@
module gitea.meta-tech.academy/go/core/util
go 1.20

10
style/go.mod Normal file
View File

@ -0,0 +1,10 @@
module gitea.meta-tech.academy/core/style
go 1.20
require github.com/gookit/color v1.5.4
require (
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 // indirect
golang.org/x/sys v0.13.0 // indirect
)

View File

@ -5,6 +5,5 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 h1:QldyIu/L63oPpyvQmHgvgickp1Yw510KJOqX7H24mg8= github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 h1:QldyIu/L63oPpyvQmHgvgickp1Yw510KJOqX7H24mg8=
github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs= github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs=
golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA= golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE=
golang.org/x/sys v0.10.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=

View File

@ -3,7 +3,7 @@ package style
import ( import (
"fmt" "fmt"
"strings" "strings"
"gitea.meta-tech.academy/go/core/util"
"github.com/gookit/color" "github.com/gookit/color"
) )
@ -62,6 +62,8 @@ func NewStyleByDef(def string) *Style {
if len(d) > KEY_STYLE_OPTION { if len(d) > KEY_STYLE_OPTION {
o = strings.Split(d[KEY_STYLE_OPTION], ",") o = strings.Split(d[KEY_STYLE_OPTION], ",")
} }
azz := util.str2int("123")
fmt.Printf(azz)
util.prependToSliceStr(&c, "#") util.prependToSliceStr(&c, "#")
var s *color.RGBStyle var s *color.RGBStyle
switch len(c) { switch len(c) {

View File

@ -1,4 +1,4 @@
module gitea.meta-tech.academy/go/core/sys module gitea.meta-tech.academy/core/sys
go 1.20 go 1.20

3
util/go.mod Normal file
View File

@ -0,0 +1,3 @@
module gitea.meta-tech.academy/core/util
go 1.20