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

lightningnetwork / lnd / 13440912774

20 Feb 2025 05:14PM UTC coverage: 57.697% (-1.1%) from 58.802%
13440912774

Pull #9535

github

guggero
GitHub: remove duplicate caching

Turns out that actions/setup-go starting with @v4 also adds caching.
With that, our cache size on disk has almost doubled, leading to the
GitHub runner running out of space in certain situation.
We fix that by disabling the automated caching since we already have our
own, custom-tailored version.
Pull Request #9535: GitHub: remove duplicate caching

103519 of 179417 relevant lines covered (57.7%)

24825.3 hits per line

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

78.95
/graph/errors.go
1
package graph
2

3
import "github.com/go-errors/errors"
4

5
// ErrorCode is used to represent the various errors that can occur within this
6
// package.
7
type ErrorCode uint8
8

9
const (
10
        // ErrOutdated is returned when the routing update already have
11
        // been applied, or a newer update is already known.
12
        ErrOutdated ErrorCode = iota
13

14
        // ErrIgnored is returned when the update have been ignored because
15
        // this update can't bring us something new, or because a node
16
        // announcement was given for node not found in any channel.
17
        ErrIgnored
18
)
19

20
// Error is a structure that represent the error inside the graph package,
21
// this structure carries additional information about error code in order to
22
// be able distinguish errors outside of the current package.
23
type Error struct {
24
        err  *errors.Error
25
        code ErrorCode
26
}
27

28
// Error represents errors as the string
29
// NOTE: Part of the error interface.
30
func (e *Error) Error() string {
×
31
        return e.err.Error()
×
32
}
×
33

34
// A compile time check to ensure Error implements the error interface.
35
var _ error = (*Error)(nil)
36

37
// NewErrf creates a Error by the given error formatted description and
38
// its corresponding error code.
39
func NewErrf(code ErrorCode, format string, a ...interface{}) *Error {
3✔
40
        return &Error{
3✔
41
                code: code,
3✔
42
                err:  errors.Errorf(format, a...),
3✔
43
        }
3✔
44
}
3✔
45

46
// IsError is a helper function which is needed to have ability to check that
47
// returned error has specific error code.
48
func IsError(e interface{}, codes ...ErrorCode) bool {
5✔
49
        err, ok := e.(*Error)
5✔
50
        if !ok {
6✔
51
                return false
1✔
52
        }
1✔
53

54
        for _, code := range codes {
8✔
55
                if err.code == code {
8✔
56
                        return true
4✔
57
                }
4✔
58
        }
59

60
        return false
×
61
}
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

© 2025 Coveralls, Inc