MCPcopy Index your code
hub / github.com/kataras/iris / SetLastModified

Method SetLastModified

context/context.go:3436–3440  ·  view source on GitHub ↗

SetLastModified sets the "Last-Modified" based on the "modtime" input. If "modtime" is zero then it does nothing. It's mostly internally on core/router and context packages.

(modtime time.Time)

Source from the content-addressed store, hash-verified

3434//
3435// It's mostly internally on core/router and context packages.
3436func (ctx *Context) SetLastModified(modtime time.Time) {
3437 if !IsZeroTime(modtime) {
3438 ctx.Header(LastModifiedHeaderKey, FormatTime(ctx, modtime.UTC())) // or modtime.UTC()?
3439 }
3440}
3441
3442// ErrPreconditionFailed may be returned from `Context` methods
3443// that has to perform one or more client side preconditions before the actual check, e.g. `CheckIfModifiedSince`.

Callers 4

WriteWithExpirationMethod · 0.95
browser.goFile · 0.80
ServeHTTPMethod · 0.80
FileServerFunction · 0.80

Calls 2

HeaderMethod · 0.95
IsZeroTimeFunction · 0.85

Tested by

no test coverage detected