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

ghettovoice / gosip / 18541436410

15 Oct 2025 08:14PM UTC coverage: 38.19% (+0.2%) from 37.954%
18541436410

push

github

ghettovoice
Use render options in send request/response methods

8 of 8 new or added lines in 1 file covered. (100.0%)

583 existing lines in 48 files now uncovered.

5347 of 14001 relevant lines covered (38.19%)

5.24 hits per line

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

67.21
/header/proxy_require.go
1
package header
2

3
import (
4
        "fmt"
5
        "io"
6
        "strconv"
7

8
        "braces.dev/errtrace"
9
        "github.com/ghettovoice/abnf"
10

11
        "github.com/ghettovoice/gosip/internal/stringutil"
12
)
13

14
type ProxyRequire Require
15

16
func (ProxyRequire) CanonicName() Name { return "Proxy-Require" }
5✔
17

UNCOV
18
func (ProxyRequire) CompactName() Name { return "Proxy-Require" }
×
19

20
func (hdr ProxyRequire) RenderTo(w io.Writer, _ ...any) error {
6✔
21
        if hdr == nil {
7✔
22
                return nil
1✔
23
        }
1✔
24
        if _, err := fmt.Fprint(w, hdr.CanonicName(), ": "); err != nil {
5✔
UNCOV
25
                return errtrace.Wrap(err)
×
UNCOV
26
        }
×
27
        return errtrace.Wrap(Require(hdr).renderValue(w))
5✔
28
}
29

30
func (hdr ProxyRequire) Render(opts ...any) string {
4✔
31
        if hdr == nil {
5✔
32
                return ""
1✔
33
        }
1✔
34
        sb := stringutil.GetStringBuilder()
3✔
35
        defer stringutil.FreeStringBuilder(sb)
3✔
36
        _ = hdr.RenderTo(sb, opts...)
3✔
37
        return sb.String()
3✔
38
}
39

40
func (hdr ProxyRequire) String() string {
3✔
41
        sb := stringutil.GetStringBuilder()
3✔
42
        defer stringutil.FreeStringBuilder(sb)
3✔
43
        _ = Require(hdr).renderValue(sb)
3✔
44
        return sb.String()
3✔
45
}
3✔
46

47
func (hdr ProxyRequire) Format(f fmt.State, verb rune) {
×
48
        switch verb {
×
49
        case 's':
×
50
                if f.Flag('+') {
×
51
                        _ = hdr.RenderTo(f)
×
52
                        return
×
53
                }
×
54
                fmt.Fprint(f, hdr.String())
×
55
                return
×
56
        case 'q':
×
57
                fmt.Fprint(f, strconv.Quote(hdr.String()))
×
58
                return
×
59
        default:
×
60
                type hideMethods ProxyRequire
×
61
                type ProxyRequire hideMethods
×
UNCOV
62
                fmt.Fprintf(f, fmt.FormatString(f, verb), ProxyRequire(hdr))
×
UNCOV
63
                return
×
64
        }
65
}
66

67
func (hdr ProxyRequire) Clone() Header {
3✔
68
        return ProxyRequire(Require(hdr).Clone().(Require)) //nolint:forcetypeassert
3✔
69
}
3✔
70

71
func (hdr ProxyRequire) Equal(val any) bool {
17✔
72
        var other ProxyRequire
17✔
73
        switch v := val.(type) {
17✔
74
        case ProxyRequire:
14✔
75
                other = v
14✔
76
        case *ProxyRequire:
2✔
77
                if v == nil {
3✔
78
                        return false
1✔
79
                }
1✔
80
                other = *v
1✔
81
        default:
1✔
82
                return false
1✔
83
        }
84
        return Require(hdr).Equal(Require(other))
15✔
85
}
86

87
func (hdr ProxyRequire) IsValid() bool { return Require(hdr).IsValid() }
4✔
88

89
func buildFromProxyRequireNode(node *abnf.Node) ProxyRequire {
1✔
90
        return ProxyRequire(buildFromRequireNode(node))
1✔
91
}
1✔
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