diff --git a/helper/http_helper/http.go b/helper/http_helper/http.go index a6080c1..3621845 100644 --- a/helper/http_helper/http.go +++ b/helper/http_helper/http.go @@ -1,6 +1,7 @@ package http_helper import ( + "bytes" "encoding/json" "errors" "fmt" @@ -160,6 +161,7 @@ func MapRequestBody(request *http.Request, dest interface{}) error { } bodyArr, err := ioutil.ReadAll(request.Body) + request.Body = io.NopCloser(bytes.NewBuffer(bodyArr)) if err != nil { return err } diff --git a/log/main.go b/log/main.go index 258439c..773e6e0 100644 --- a/log/main.go +++ b/log/main.go @@ -142,7 +142,6 @@ func (l *Logger) WithWarning() *Logger { } func (l *Logger) WithTimestamp() *Logger { - println("setting the withtimesramp") for _, logger := range l.Loggers { logger.UseTimestamp(true) } diff --git a/version/main.go b/version/main.go index 9d7f0ec..37b6db4 100644 --- a/version/main.go +++ b/version/main.go @@ -71,7 +71,12 @@ func Get(v ...int) *Version { } func (v *Version) String() string { - return fmt.Sprint(v.Major) + "." + fmt.Sprint(v.Minor) + "." + fmt.Sprint(v.Build) + "." + fmt.Sprint(v.Rev) + if v.Rev > 0 { + return fmt.Sprint(v.Major) + "." + fmt.Sprint(v.Minor) + "." + fmt.Sprint(v.Build) + "." + fmt.Sprint(v.Rev) + + } else { + return fmt.Sprint(v.Major) + "." + fmt.Sprint(v.Minor) + "." + fmt.Sprint(v.Build) + } } func FromString(ver string) (*Version, error) { diff --git a/version/main_test.go b/version/main_test.go index d364d6f..5f4d424 100644 --- a/version/main_test.go +++ b/version/main_test.go @@ -131,7 +131,7 @@ func TestToString(t *testing.T) { //Assert assert.NotNilf(t, v, "Version should not be null") assert.Nilf(t, err, "Error should be nil") - assert.Equalf(t, "1.1.1.0", v.String(), "ToString should be equal to 1.1.1.0") + assert.Equalf(t, "1.1.1", v.String(), "ToString should be equal to 1.1.1") } func TestEmptyGet(t *testing.T) {