From a1f6039d82951a2f6f0f918768a996b4b31b2747 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=82=85=E5=B0=8F=E9=BB=91?= Date: Tue, 24 Dec 2013 21:59:00 +0800 Subject: [PATCH] gofmt code --- cache/file.go | 6 +++--- config/config.go | 2 +- config/ini.go | 2 +- config/json.go | 10 +++++----- config/xml.go | 1 - 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/cache/file.go b/cache/file.go index a80f3678..3807fa7c 100644 --- a/cache/file.go +++ b/cache/file.go @@ -34,9 +34,9 @@ type FileCacheItem struct { var ( FileCachePath string = "cache" // cache directory - FileCacheFileSuffix string = ".bin" // cache file suffix - FileCacheDirectoryLevel int = 2 // cache file deep level if auto generated cache files. - FileCacheEmbedExpiry int64 = 0 // cache expire time, default is no expire forever. + FileCacheFileSuffix string = ".bin" // cache file suffix + FileCacheDirectoryLevel int = 2 // cache file deep level if auto generated cache files. + FileCacheEmbedExpiry int64 = 0 // cache expire time, default is no expire forever. ) // FileCache is cache adapter for file storage. diff --git a/config/config.go b/config/config.go index 63ca7c48..5fb0dd81 100644 --- a/config/config.go +++ b/config/config.go @@ -7,7 +7,7 @@ import ( // ConfigContainer defines how to get and set value from configuration raw data. type ConfigContainer interface { Set(key, val string) error // support section::key type in given key when using ini type. - String(key string) string // support section::key type in key string when using ini and json type; Int,Int64,Bool,Float,DIY are same. + String(key string) string // support section::key type in key string when using ini and json type; Int,Int64,Bool,Float,DIY are same. Int(key string) (int, error) Int64(key string) (int64, error) Bool(key string) (bool, error) diff --git a/config/ini.go b/config/ini.go index 2ca4b030..6ac79295 100644 --- a/config/ini.go +++ b/config/ini.go @@ -13,7 +13,7 @@ import ( ) var ( - DEFAULT_SECTION = "default" // default section means if some ini items not in a section, make them in default section, + DEFAULT_SECTION = "default" // default section means if some ini items not in a section, make them in default section, bNumComment = []byte{'#'} // number signal bSemComment = []byte{';'} // semicolon signal bEmpty = []byte{} diff --git a/config/json.go b/config/json.go index a74ac7df..883e0674 100644 --- a/config/json.go +++ b/config/json.go @@ -53,7 +53,7 @@ func (c *JsonConfigContainer) Bool(key string) (bool, error) { } else { return false, errors.New("not exist key:" + key) } - return false,nil + return false, nil } // Int returns the integer value for a given key. @@ -68,7 +68,7 @@ func (c *JsonConfigContainer) Int(key string) (int, error) { } else { return 0, errors.New("not exist key:" + key) } - return 0,nil + return 0, nil } // Int64 returns the int64 value for a given key. @@ -83,7 +83,7 @@ func (c *JsonConfigContainer) Int64(key string) (int64, error) { } else { return 0, errors.New("not exist key:" + key) } - return 0,nil + return 0, nil } // Float returns the float value for a given key. @@ -98,7 +98,7 @@ func (c *JsonConfigContainer) Float(key string) (float64, error) { } else { return 0.0, errors.New("not exist key:" + key) } - return 0.0,nil + return 0.0, nil } // String returns the string value for a given key. @@ -132,7 +132,7 @@ func (c *JsonConfigContainer) DIY(key string) (v interface{}, err error) { } else { return nil, errors.New("not exist key") } - return nil,nil + return nil, nil } // section.key or key diff --git a/config/xml.go b/config/xml.go index 7bc0ec02..35f19336 100644 --- a/config/xml.go +++ b/config/xml.go @@ -1,4 +1,3 @@ - package config import (