1
0
mirror of https://github.com/kataras/iris.git synced 2025-12-17 09:57:01 +00:00

release version 12.2.10

This commit is contained in:
Gerasimos (Makis) Maropoulos
2024-01-18 03:11:54 +02:00
parent 12546322eb
commit 113ce190e6
31 changed files with 314 additions and 208 deletions

View File

@@ -50,11 +50,11 @@ func (r resource) loadFromBase(dir string) string {
}
result := string(b)
if runtime.GOOS != "windows" {
result = strings.ReplaceAll(result, "\n", "\r\n")
result = strings.ReplaceAll(result, "\r\r", "")
}
return result
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -50,6 +50,11 @@ func (r resource) loadFromBase(dir string) string {
}
result := string(b)
if runtime.GOOS != "windows" {
result = strings.ReplaceAll(result, "\n", "\r\n")
result = strings.ReplaceAll(result, "\r\r", "")
}
return result
}

View File

@@ -3,6 +3,9 @@ package main
import (
"bytes"
"encoding/json"
"fmt"
"path"
"runtime"
"strings"
"sync"
"testing"
@@ -30,7 +33,8 @@ func TestJSONLogger(t *testing.T) {
app.Get("/ping", ping)
const expectedLogStr = `{"level":"debug","message":"Request path: /ping","fields":{"request_id":null},"stacktrace":[{"function":"json-logger/ping","source":"/home/runner/work/iris/iris/_examples/logging/json-logger/main.go:78"}]}` // gh actions-specific.
expectedSourceDir := getSourceDirPath()
expectedLogStr := fmt.Sprintf(`{"level":"debug","message":"Request path: /ping","fields":{"request_id":null},"stacktrace":[{"function":"json-logger/ping","source":"%s/main.go:78"}]}`, expectedSourceDir) // gh actions-specific.
e := httptest.New(t, app, httptest.LogLevel("debug"))
wg := new(sync.WaitGroup)
wg.Add(iters)
@@ -57,3 +61,12 @@ func TestJSONLogger(t *testing.T) {
}
}
}
func getSourceDirPath() string {
_, file, _, ok := runtime.Caller(1) // get the caller's file.
if !ok {
return "unknown source"
}
return path.Dir(file) // get the directory of the file (delimiter: /).
}