// Read the INI-style configuration file package main import ( "gopkg.in/ini.v1" ) func readConf(file string) error { cfg, err := ini.Load(file) if err != nil { return err } conf.danmaku, _ = cfg.Section("mai").Key("danmaku").Int() conf.listen = cfg.Section("mai").Key("listen").String() conf.staticpath = cfg.Section("mai").Key("static").String() conf.tmplpath = cfg.Section("mai").Key("templates").String() return nil }