From dee542df424a46a699554428ea3a081373aca1ab Mon Sep 17 00:00:00 2001 From: astaxie Date: Thu, 22 Aug 2013 13:46:22 +0800 Subject: [PATCH] fix yaml --- config/yaml.go | 4 ++-- config/yaml_test.go | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/config/yaml.go b/config/yaml.go index 8ba3ca58..fab15708 100644 --- a/config/yaml.go +++ b/config/yaml.go @@ -80,8 +80,8 @@ func (c *YAMLConfigContainer) Bool(key string) (bool, error) { } func (c *YAMLConfigContainer) Int(key string) (int, error) { - if v, ok := c.data[key].(int); ok { - return v, nil + if v, ok := c.data[key].(int64); ok { + return int(v), nil } return 0, errors.New("not int value") } diff --git a/config/yaml_test.go b/config/yaml_test.go index 45142e76..51165e7b 100644 --- a/config/yaml_test.go +++ b/config/yaml_test.go @@ -6,12 +6,12 @@ import ( ) var yamlcontext = ` -"appname": "beeapi", -"httpport": 8080, -"mysqlport": 3600, -"PI": 3.1415976, -"runmode": "dev", -"autorender": false, +"appname": beeapi +"httpport": 8080 +"mysqlport": 3600 +"PI": 3.1415976 +"runmode": dev +"autorender": false "copyrequestbody": true `