Something will be done eventually

Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja>

git-svn-id: file:///srv/svn/repo/chen/trunk@39 32723744-9b23-0b4a-b1da-9b2e968f9461
This commit is contained in:
yakumo.izuru 2024-04-01 18:53:04 +00:00
parent 619c85f2aa
commit e1bc4f166c
3 changed files with 48 additions and 0 deletions

34
cmd/chen/main.go Normal file
View File

@ -0,0 +1,34 @@
package main
import (
"gopkg.in/ini.v1"
)
var chen struct {
jid string
password string
prefix string
nick string
autojoin string
}
func readConf(file string) error {
cfg, err := ini.Load(file)
if err != nil {
return err
}
chen.jid = cfg.Section("chen").Key("jid").String()
chen.password = cfg.Section("chen").Key("password").String()
chen.prefix = cfg.Section("chen").Key("prefix").String()
chen.nick = cfg.Section("chen").Key("nick").String()
chen.autojoin = cfg.Section("chen").Key("autojoin").String()
return nil
}
func main() {
readConf(chen.ini)
// Do whatever here
}

7
go.mod Normal file
View File

@ -0,0 +1,7 @@
module git.chaotic.ninja/yakumo_izuru/chen
go 1.20
require gopkg.in/ini.v1 v1.67.0
require github.com/stretchr/testify v1.9.0 // indirect

7
go.sum Normal file
View File

@ -0,0 +1,7 @@
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=