You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running the following code returns a ModTime of epoch when it should return a time of the file creation date.
This assumes that the file is saved as main.go
package main
import"embed"//go:embed main.govarcontent embed.FSfuncmain() {
f, err:=content.Open("main.go")
iferr!=nil {
panic(err)
}
stat, err:=f.Stat()
iferr!=nil {
panic(err)
}
ifstat.ModTime().IsZero() {
panic("Does not retain the original f.Stat().ModTime()")
}
}
What did you expect to see?
Running the above code should not panic since the time returned from the embed.FS structure should be non zero.
What did you see instead?
The following example will panic with:
Does not retain the original f.Stat().ModTime()
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes, currently testing against the latest for MacOS.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Running the following code returns a ModTime of epoch when it should return a time of the file creation date.
This assumes that the file is saved as
main.go
What did you expect to see?
Running the above code should not panic since the time returned from the embed.FS structure should be non zero.
What did you see instead?
The following example will panic with:
The text was updated successfully, but these errors were encountered: