/
githubmirror
/
LeetCode-Go
Обзор
Документация
Войти
/
githubmirror
/
LeetCode-Go
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
ctl/config.go
32 строки
498 B
halfrost
add new pdf version
28 июн 2026, 09:46
28 июн 2026, 09:46
fb26e8e
Код
Авторство
О чём код?
package main import ( "fmt" "log" "github.com/BurntSushi/toml" ) const ( configTOML = "config.toml" ) type config struct { Username string Password string Cookie string CSRFtoken string } func (c config) String() string { return fmt.Sprintf("Username: %s, Password: %s", c.Username, c.Password) } func getConfig() *config { cfg := new(config) if _, err := toml.DecodeFile(configTOML, &cfg); err != nil { log.Panic(err) } // log.Printf("get config: %s", cfg) return cfg }