(name string)
| 24 | } |
| 25 | |
| 26 | func (e *embedFileSystem) Open(name string) (http.File, error) { |
| 27 | if name == "/" { |
| 28 | // This will make sure the index page goes to NoRouter handler, |
| 29 | // which will use the replaced index bytes with analytic codes. |
| 30 | return nil, os.ErrNotExist |
| 31 | } |
| 32 | return e.FileSystem.Open(name) |
| 33 | } |
| 34 | |
| 35 | func EmbedFolder(fsEmbed embed.FS, targetPath string) static.ServeFileSystem { |
| 36 | efs, err := fs.Sub(fsEmbed, targetPath) |
no outgoing calls