From b5db76b87a6a430c80c6467b62837a52099fb7f9 Mon Sep 17 00:00:00 2001 From: Manu Mtz-Almeida Date: Fri, 4 Jul 2014 16:59:57 +0200 Subject: [PATCH] Adds default config variable --- gin.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gin.go b/gin.go index d76eae1..03bf8e5 100644 --- a/gin.go +++ b/gin.go @@ -68,6 +68,13 @@ type ( } ) +var ( + DefaultConfig = Config{ + CacheSize: 1024, + Preallocated: 512, + } +) + func (a ErrorMsgs) String() string { var buffer bytes.Buffer for i, msg := range a { @@ -101,10 +108,7 @@ func NewWithConfig(config Config) *Engine { // Returns a new blank Engine instance without any middleware attached. // The most basic configuration func New() *Engine { - return NewWithConfig(Config{ - CacheSize: 1024, - Preallocated: 512, - }) + return NewWithConfig(DefaultConfig) } // Returns a Engine instance with the Logger and Recovery already attached.