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

yyle88 / gormmom / 12263342139

10 Dec 2024 07:29PM UTC coverage: 70.28%. First build
12263342139

push

github

yangyile
继续优化代码

45 of 56 new or added lines in 5 files covered. (80.36%)

402 of 572 relevant lines covered (70.28%)

17.15 hits per line

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

84.21
/internal/unicodehex/unicodehex.go
1
package unicodehex
2

3
import (
4
        "encoding/binary"
5
        "encoding/hex"
6
        "strings"
7
)
8

9
func StringToHex4Uppercase(s string) (results []string) {
6✔
10
        for _, c := range s {
36✔
11
                results = append(results, Uint32ToHex4Uppercase(c))
30✔
12
        }
30✔
13
        return results
6✔
14
}
15

NEW
16
func Uint32ToHex4Lowercase(c int32) string {
×
NEW
17
        return strings.ToLower(Uint32ToHex4s(uint32(c)))
×
NEW
18
}
×
19

20
func Uint32ToHex4Uppercase(c int32) string {
30✔
21
        return strings.ToUpper(Uint32ToHex4s(uint32(c)))
30✔
22
}
30✔
23

24
func Uint32ToHex4s(x uint32) string {
30✔
25
        return hex.EncodeToString(Uint32ToLittleEndianBytes(x))[:4]
30✔
26
}
30✔
27

28
func Uint32ToLittleEndianBytes(x uint32) []byte {
30✔
29
        var src = make([]byte, 4)
30✔
30
        binary.LittleEndian.PutUint32(src, uint32(x))
30✔
31
        return src
30✔
32
}
30✔
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