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

lightningnetwork / lnd / 13481548301

23 Feb 2025 09:06AM UTC coverage: 4.031% (-54.8%) from 58.825%
13481548301

Pull #9521

github

web-flow
Merge 1ffbe99fe into 5fe900d18
Pull Request #9521: unit: remove GOACC, use Go 1.20 native coverage functionality

2852 of 70750 relevant lines covered (4.03%)

0.92 hits per line

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

0.0
/sqldb/sqlutils.go
1
package sqldb
2

3
import (
4
        "database/sql"
5
        "time"
6

7
        "golang.org/x/exp/constraints"
8
)
9

10
// SQLInt32 turns a numerical integer type into the NullInt32 that sql/sqlc
11
// uses when an integer field can be permitted to be NULL.
12
//
13
// We use this constraints.Integer constraint here which maps to all signed and
14
// unsigned integer types.
15
func SQLInt32[T constraints.Integer](num T) sql.NullInt32 {
×
16
        return sql.NullInt32{
×
17
                Int32: int32(num),
×
18
                Valid: true,
×
19
        }
×
20
}
×
21

22
// SQLInt64 turns a numerical integer type into the NullInt64 that sql/sqlc
23
// uses when an integer field can be permitted to be NULL.
24
//
25
// We use this constraints.Integer constraint here which maps to all signed and
26
// unsigned integer types.
27
func SQLInt64[T constraints.Integer](num T) sql.NullInt64 {
×
28
        return sql.NullInt64{
×
29
                Int64: int64(num),
×
30
                Valid: true,
×
31
        }
×
32
}
×
33

34
// SQLStr turns a string into the NullString that sql/sqlc uses when a string
35
// can be permitted to be NULL.
36
func SQLStr(s string) sql.NullString {
×
37
        if s == "" {
×
38
                return sql.NullString{}
×
39
        }
×
40

41
        return sql.NullString{
×
42
                String: s,
×
43
                Valid:  true,
×
44
        }
×
45
}
46

47
// SQLTime turns a time.Time into the NullTime that sql/sqlc uses when a time
48
// can be permitted to be NULL.
49
func SQLTime(t time.Time) sql.NullTime {
×
50
        return sql.NullTime{
×
51
                Time:  t,
×
52
                Valid: true,
×
53
        }
×
54
}
×
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