| 1 | package glob |
| 2 | |
| 3 | import "os" |
| 4 | |
| 5 | // FileAsset contains file information and path from globbing. |
| 6 | type FileAsset struct { |
| 7 | os.FileInfo |
| 8 | // Path to asset |
| 9 | Path string |
| 10 | } |
| 11 | |
| 12 | // Stat updates the stat of this asset. |
| 13 | func (fa *FileAsset) Stat() (*os.FileInfo, error) { |
| 14 | fi, err := os.Stat(fa.Path) |
| 15 | if err != nil { |
| 16 | return nil, err |
| 17 | } |
| 18 | fa.FileInfo = fi |
| 19 | return &fa.FileInfo, nil |
| 20 | } |