optionalTimeout converts an integer timeout (in seconds) into a *time.Duration. If changed is false, nil is returned (no timeout was explicitly set).
(t int, changed bool)
| 37 | // optionalTimeout converts an integer timeout (in seconds) into a *time.Duration. |
| 38 | // If changed is false, nil is returned (no timeout was explicitly set). |
| 39 | func optionalTimeout(t int, changed bool) *time.Duration { |
| 40 | if !changed { |
| 41 | return nil |
| 42 | } |
| 43 | d := time.Duration(t) * time.Second |
| 44 | return &d |
| 45 | } |
no outgoing calls
no test coverage detected