NewOutput creates a new [Output] timestamped with the current time.
(t Type, opts ...OutputOpt)
| 46 | |
| 47 | // NewOutput creates a new [Output] timestamped with the current time. |
| 48 | func NewOutput(t Type, opts ...OutputOpt) Output { |
| 49 | o := &Output{ |
| 50 | Type: t, |
| 51 | Timestamp: time.Now(), |
| 52 | } |
| 53 | for _, opt := range opts { |
| 54 | opt(o) |
| 55 | } |
| 56 | |
| 57 | return *o |
| 58 | } |
| 59 | |
| 60 | type OutputOpt func(*Output) |
| 61 |
no outgoing calls
no test coverage detected