• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

gatewayd-io / gatewayd / 11778041607

11 Nov 2024 11:57AM UTC coverage: 62.563% (-0.03%) from 62.591%
11778041607

push

github

web-flow
Update deps (#631)

* Install latest version of OpenSSL to fix CVE-2024-9143
* Update action
* Fix linter error
* Convert all function to pointer receivers

9 of 22 new or added lines in 2 files covered. (40.91%)

3 existing lines in 2 files now uncovered.

4569 of 7303 relevant lines covered (62.56%)

10.42 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

73.33
/network/stack.go
1
package network
2

3
import "sync"
4

5
type Request struct {
6
        Data []byte
7
}
8

9
type Stack struct {
10
        items []*Request
11
        mu    sync.RWMutex
12
}
13

14
func (s *Stack) Push(req *Request) {
4✔
15
        s.mu.Lock()
4✔
16
        defer s.mu.Unlock()
4✔
17

4✔
18
        s.items = append(s.items, req)
4✔
19
}
4✔
20

21
func (s *Stack) GetLastRequest() *Request {
×
22
        s.mu.RLock()
×
23
        defer s.mu.RUnlock()
×
24

×
25
        if len(s.items) == 0 {
×
26
                return nil
×
27
        }
×
28

29
        return s.items[len(s.items)-1]
×
30
}
31

32
func (s *Stack) PopLastRequest() *Request {
4✔
33
        s.mu.Lock()
4✔
34
        defer s.mu.Unlock()
4✔
35

4✔
36
        if len(s.items) == 0 {
4✔
UNCOV
37
                return nil
×
UNCOV
38
        }
×
39

40
        lastItem := len(s.items) - 1
4✔
41
        req := s.items[lastItem]
4✔
42
        s.items = append(s.items[:lastItem], s.items[lastItem+1:]...)
4✔
43
        return req
4✔
44
}
45

46
func (s *Stack) UpdateLastRequest(req *Request) {
4✔
47
        s.mu.Lock()
4✔
48
        defer s.mu.Unlock()
4✔
49

4✔
50
        if len(s.items) == 0 {
4✔
51
                return
×
52
        }
×
53

54
        s.items[len(s.items)-1] = req
4✔
55
}
56

57
func (s *Stack) Clear() {
2✔
58
        s.mu.Lock()
2✔
59
        defer s.mu.Unlock()
2✔
60

2✔
61
        s.items = make([]*Request, 0)
2✔
62
}
2✔
63

64
func NewStack() *Stack {
2✔
65
        return &Stack{
2✔
66
                items: make([]*Request, 0),
2✔
67
                mu:    sync.RWMutex{},
2✔
68
        }
2✔
69
}
2✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc