21 lines
299 B
Go
21 lines
299 B
Go
package ordoor
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
func (o *Ordoor) DisplayImageFor(d time.Duration, name string) error {
|
|
img, err := o.assets.Image(name)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
o.pic = img
|
|
go func() {
|
|
<-time.After(d)
|
|
o.pic = nil // FIXME: this is a race condition and a half
|
|
}()
|
|
|
|
return nil
|
|
}
|