MCPcopy
hub / github.com/docker/compose / optionalTimeout

Function optionalTimeout

cmd/compose/backend.go:39–45  ·  cmd/compose/backend.go::optionalTimeout

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)

Source from the content-addressed store, hash-verified

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).
39func 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}

Callers 2

runStopFunction · 0.85
runRestartFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected