General refactoring. Part 2.

This commit is contained in:
Manu Mtz-Almeida
2014-10-09 01:40:42 +02:00
parent 030706c39a
commit aa7b00a083
7 changed files with 163 additions and 147 deletions

View File

@ -6,7 +6,6 @@ package gin
import (
"encoding/xml"
"fmt"
"reflect"
"runtime"
"strings"
@ -39,20 +38,14 @@ func (h H) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
}
func filterFlags(content string) string {
for i, a := range content {
if a == ' ' || a == ';' {
for i, char := range content {
if char == ' ' || char == ';' {
return content[:i]
}
}
return content
}
func debugPrint(format string, values ...interface{}) {
if IsDebugging() {
fmt.Printf("[GIN-debug] "+format, values)
}
}
func chooseData(custom, wildcard interface{}) interface{} {
if custom == nil {
if wildcard == nil {
@ -84,6 +77,6 @@ func lastChar(str string) uint8 {
return str[size-1]
}
func nameOfFuncion(f interface{}) string {
func nameOfFunction(f interface{}) string {
return runtime.FuncForPC(reflect.ValueOf(f).Pointer()).Name()
}