Something will be done eventually
Signed-off-by: Izuru Yakumo <yakumo.izuru@chaotic.ninja> git-svn-id: https://svn.yakumo.dev/yakumo.izuru/chen/trunk@39 32723744-9b23-0b4a-b1da-9b2e968f9461
This commit is contained in:
parent
b5ec2a17a5
commit
7bebef3097
34
cmd/chen/main.go
Normal file
34
cmd/chen/main.go
Normal 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
7
go.mod
Normal 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
7
go.sum
Normal 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=
|
Loading…
x
Reference in New Issue
Block a user