(path string, name ...string)
| 331 | } |
| 332 | |
| 333 | func NewLocalFile(path string, name ...string) (*FileElement, error) { |
| 334 | file, err := os.Open(path) |
| 335 | if err != nil { |
| 336 | return nil, err |
| 337 | } |
| 338 | return NewStreamFile(file, utils.LazyTernary(len(name) == 0, func() string { |
| 339 | return filepath.Base(file.Name()) |
| 340 | }, func() string { |
| 341 | return name[0] |
| 342 | })), nil |
| 343 | } |
| 344 | |
| 345 | func NewLightApp(content string) *LightAppElement { |
| 346 | return &LightAppElement{ |
nothing calls this directly
no test coverage detected