Skip to content

Commit

Permalink
Preparing release Gin v1.0rc1
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat committed May 22, 2015
1 parent 8549810 commit 66fa43f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
#Changelog

###Gin 1.0 (...)
###Gin 1.0rc1 (May 22, 2015)

- [PERFORMANCE] Zero allocation router
- [PERFORMANCE] Faster JSON, XML and text rendering
- [PERFORMANCE] Custom hand optimized HttpRouter for Gin
- [PERFORMANCE] Misc code optimizations. Inlining, tail call optimizations
- [NEW] Built-in support for golang.org/x/net/context
- [NEW] Any(path, handler). Create a route that matches any path
- [NEW] Refactored rendering pipeline (faster and static typeded)
- [NEW] Refactored errors API
- [NEW] IndentedJSON() prints pretty JSON
- [NEW] Added gin.DefaultWriter
- [NEW] UNIX socket support
- [NEW] RouterGroup.BasePath is exposed
- [NEW] JSON validation using go-validate-yourself (very powerful options)
- [NEW] Completed suite of unit tests
- [NEW] HTTP streaming with c.Stream()
- [NEW] StaticFile() creates a router for serving just one file.
- [NEW] StaticFS() has an option to disable directory listing.
- [NEW] StaticFS() for serving static files through virtual filesystems
- [NEW] Server-Sent Events native support
- [NEW] WrapF() and WrapH() helpers for wrapping http.HandlerFunc and http.Handler
Expand All @@ -28,6 +32,7 @@
- [FIX] Redirect using built-in http.Redirect()
- [FIX] Logger when printing the requested path
- [FIX] Documentation typos
- [FIX] Context.Engine renamed to Context.engine
- [FIX] Better debugging messages
- [FIX] ErrorLogger
- [FIX] Debug HTTP render
Expand Down
2 changes: 1 addition & 1 deletion examples/example_basic.go → examples/basic/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func main() {
Value string `json:"value" binding:"required"`
}

if c.Bind(&json) {
if c.Bind(&json) == nil {
DB[user] = json.Value
c.JSON(200, gin.H{"status": "ok"})
}
Expand Down
2 changes: 2 additions & 0 deletions gin.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import (
"github.com/gin-gonic/gin/render"
)

const Version = "v1.0rc1"

var default404Body = []byte("404 page not found")
var default405Body = []byte("405 method not allowed")

Expand Down
11 changes: 6 additions & 5 deletions mode.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
package gin

import (
"io"
"os"

"github.com/mattn/go-colorable"
)

const GIN_MODE = "GIN_MODE"
const ENV_GIN_MODE = "GIN_MODE"

const (
DebugMode string = "debug"
Expand All @@ -23,16 +24,16 @@ const (
testCode = iota
)

var DefaultWriter = colorable.NewColorableStdout()
var DefaultWriter io.Writer = colorable.NewColorableStdout()
var ginMode int = debugCode
var modeName string = DebugMode

func init() {
value := os.Getenv(GIN_MODE)
if len(value) == 0 {
mode := os.Getenv(ENV_GIN_MODE)
if len(mode) == 0 {
SetMode(DebugMode)
} else {
SetMode(value)
SetMode(mode)
}
}

Expand Down

0 comments on commit 66fa43f

Please sign in to comment.