Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
30 lines (23 sloc) 421 Bytes
package config
import (
"encoding/json"
"github.com/redsofa/middleware-test/logger"
"os"
)
var ServerConf Config
type Config struct {
Port int
AuthPass bool
}
func ReadServerConf() {
f, err := os.Open("server_config.json")
defer f.Close()
if err != nil {
logger.Error.Println(err)
}
decoder := json.NewDecoder(f)
err = decoder.Decode(&ServerConf)
if err != nil {
logger.Error.Println(err)
}
}
You can’t perform that action at this time.