MCPcopy
hub / github.com/gofiber/fiber / Start

Method Start

services_test.go:106–131  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

104}
105
106func (m *mockService) Start(ctx context.Context) error {
107 select {
108 case <-ctx.Done():
109 return fmt.Errorf("context canceled: %w", ctx.Err())
110 default:
111 }
112
113 if m.startDelay > 0 {
114 timer := time.NewTimer(m.startDelay)
115 select {
116 case <-ctx.Done():
117 timer.Stop()
118 return fmt.Errorf("context canceled: %w", ctx.Err())
119 case <-timer.C:
120 // Continue after delay
121 }
122 }
123
124 if m.startError != nil {
125 m.started = false
126 return m.startError
127 }
128
129 m.started = true
130 return nil
131}
132
133func (m *mockService) String() string {
134 return m.name

Callers

nothing calls this directly

Calls 3

DoneMethod · 0.65
ErrorfMethod · 0.65
ErrMethod · 0.65

Tested by

no test coverage detected