Skip to content

embed: embed.file.ModTime() returns zero time #46935

@yffrankwang

Description

@yffrankwang

The current implementation of embed.file just returns zero time.

func (f *file) ModTime() time.Time         { return time.Time{} }

The http file server does not set the http header 'Date', if file's ModTime is zero.

http.Handle("/static/", http.StripPrefix("/static/", http.FileServer(http.FS(content))))

Is it possible to set the local file's real modification time to the embed file at compile time?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions