mirror of
https://github.com/kataras/iris.git
synced 2026-01-24 20:35:59 +00:00
formatting
Former-commit-id: 037081db5d6d4434e873ca8b75334ee43e046b6a
This commit is contained in:
@@ -107,7 +107,6 @@ func (b *basicAuthMiddleware) askForCredentials(ctx context.Context) {
|
||||
|
||||
// Serve the actual middleware
|
||||
func (b *basicAuthMiddleware) Serve(ctx context.Context) {
|
||||
|
||||
auth, found := b.findAuth(ctx.GetHeader("Authorization"))
|
||||
if !found {
|
||||
b.askForCredentials(ctx)
|
||||
|
||||
@@ -82,7 +82,7 @@ func New(c Config) context.Handler {
|
||||
}
|
||||
i := &i18nMiddleware{config: c}
|
||||
firstlanguage := ""
|
||||
//load the files
|
||||
// load the files
|
||||
for k, langFileOrFiles := range c.Languages {
|
||||
// remove all spaces.
|
||||
langFileOrFiles = strings.Replace(langFileOrFiles, " ", "", -1)
|
||||
|
||||
@@ -41,7 +41,7 @@ func (l *requestLoggerMiddleware) ServeHTTP(ctx context.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
//all except latency to string
|
||||
// all except latency to string
|
||||
var status, ip, method, path string
|
||||
var latency time.Duration
|
||||
var startTime, endTime time.Time
|
||||
@@ -49,7 +49,7 @@ func (l *requestLoggerMiddleware) ServeHTTP(ctx context.Context) {
|
||||
|
||||
ctx.Next()
|
||||
|
||||
//no time.Since in order to format it well after
|
||||
// no time.Since in order to format it well after
|
||||
endTime = time.Now()
|
||||
latency = endTime.Sub(startTime)
|
||||
|
||||
@@ -126,7 +126,6 @@ func (l *requestLoggerMiddleware) ServeHTTP(ctx context.Context) {
|
||||
// Columnize formats the given arguments as columns and returns the formatted output,
|
||||
// note that it appends a new line to the end.
|
||||
func Columnize(nowFormatted string, latency time.Duration, status, ip, method, path string, message interface{}, headerMessage interface{}) string {
|
||||
|
||||
titles := "Time | Status | Latency | IP | Method | Path"
|
||||
line := fmt.Sprintf("%s | %v | %4v | %s | %s | %s", nowFormatted, status, latency, ip, method, path)
|
||||
if message != nil {
|
||||
|
||||
@@ -65,7 +65,6 @@ func SiteFerify(ctx context.Context, secret string) (response Response) {
|
||||
// optional: let's no track our users "remoteip": {ctx.RemoteAddr()},
|
||||
},
|
||||
)
|
||||
|
||||
if err != nil {
|
||||
response.ErrorCodes = append(response.ErrorCodes, err.Error())
|
||||
return
|
||||
|
||||
@@ -35,7 +35,6 @@ func New() context.Handler {
|
||||
_, f, l, got := runtime.Caller(i)
|
||||
if !got {
|
||||
break
|
||||
|
||||
}
|
||||
|
||||
stacktrace += fmt.Sprintf("%s:%d\n", f, l)
|
||||
|
||||
Reference in New Issue
Block a user