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

yyle88 / goi18n / 15066837663

16 May 2025 10:54AM UTC coverage: 48.496% (+21.9%) from 26.619%
15066837663

push

github

yangyile
补充测试内容

120 of 297 new or added lines in 10 files covered. (40.4%)

52 existing lines in 1 file now uncovered.

258 of 532 relevant lines covered (48.5%)

30.38 hits per line

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

11.01
/internal/examples/example1/example1generate/example1message/message.go
1
package example1message
2

3
import "github.com/nicksnyder/go-i18n/v2/i18n"
4

5
type ErrorAlreadyExistParam struct {
6
        What any
7
        Code any
8
}
9

10
func (p *ErrorAlreadyExistParam) GetTemplateValues() map[string]any {
2✔
11
        res := make(map[string]any)
2✔
12
        if p.What != nil {
4✔
13
                res["what"] = p.What
2✔
14
        }
2✔
15
        if p.Code != nil {
4✔
16
                res["code"] = p.Code
2✔
17
        }
2✔
18
        return res
2✔
19
}
20

21
func NewErrorAlreadyExist(data *ErrorAlreadyExistParam) (string, map[string]any) {
2✔
22
        return "ERROR_ALREADY_EXIST", data.GetTemplateValues()
2✔
23
}
2✔
24

UNCOV
25
func I18nErrorAlreadyExist(data *ErrorAlreadyExistParam) *i18n.LocalizeConfig {
×
UNCOV
26
        return &i18n.LocalizeConfig{
×
UNCOV
27
                MessageID:    "ERROR_ALREADY_EXIST",
×
UNCOV
28
                TemplateData: data.GetTemplateValues(),
×
UNCOV
29
        }
×
UNCOV
30
}
×
31

32
type ErrorBadParamParam struct {
33
        Name any
34
}
35

36
func (p *ErrorBadParamParam) GetTemplateValues() map[string]any {
×
37
        res := make(map[string]any)
×
38
        if p.Name != nil {
×
39
                res["name"] = p.Name
×
40
        }
×
41
        return res
×
42
}
43

44
func NewErrorBadParam(data *ErrorBadParamParam) (string, map[string]any) {
×
45
        return "ERROR_BAD_PARAM", data.GetTemplateValues()
×
46
}
×
47

48
func I18nErrorBadParam(data *ErrorBadParamParam) *i18n.LocalizeConfig {
×
49
        return &i18n.LocalizeConfig{
×
50
                MessageID:    "ERROR_BAD_PARAM",
×
51
                TemplateData: data.GetTemplateValues(),
×
52
        }
×
53
}
×
54

55
type ErrorNotExistParam struct {
56
        What any
57
        Code any
58
}
59

UNCOV
60
func (p *ErrorNotExistParam) GetTemplateValues() map[string]any {
×
UNCOV
61
        res := make(map[string]any)
×
UNCOV
62
        if p.What != nil {
×
UNCOV
63
                res["what"] = p.What
×
UNCOV
64
        }
×
UNCOV
65
        if p.Code != nil {
×
UNCOV
66
                res["code"] = p.Code
×
UNCOV
67
        }
×
UNCOV
68
        return res
×
69
}
70

71
func NewErrorNotExist(data *ErrorNotExistParam) (string, map[string]any) {
×
72
        return "ERROR_NOT_EXIST", data.GetTemplateValues()
×
73
}
×
74

UNCOV
75
func I18nErrorNotExist(data *ErrorNotExistParam) *i18n.LocalizeConfig {
×
UNCOV
76
        return &i18n.LocalizeConfig{
×
UNCOV
77
                MessageID:    "ERROR_NOT_EXIST",
×
UNCOV
78
                TemplateData: data.GetTemplateValues(),
×
UNCOV
79
        }
×
UNCOV
80
}
×
81

82
type NewMessagesParam struct {
83
        Name  any
84
        Count any
85
}
86

87
func (p *NewMessagesParam) GetTemplateValues() map[string]any {
×
88
        res := make(map[string]any)
×
89
        if p.Name != nil {
×
90
                res["name"] = p.Name
×
91
        }
×
92
        if p.Count != nil {
×
93
                res["count"] = p.Count
×
94
        }
×
95
        return res
×
96
}
97

98
func NewNewMessages(data *NewMessagesParam) (string, map[string]any) {
×
99
        return "NEW_MESSAGES", data.GetTemplateValues()
×
100
}
×
101

102
func I18nNewMessages(data *NewMessagesParam) *i18n.LocalizeConfig {
×
103
        return &i18n.LocalizeConfig{
×
104
                MessageID:    "NEW_MESSAGES",
×
105
                TemplateData: data.GetTemplateValues(),
×
106
        }
×
107
}
×
108

109
func NewPleaseConfirm[Value comparable](value Value) (string, Value) {
×
110
        return "PLEASE_CONFIRM", value
×
111
}
×
112

UNCOV
113
func I18nPleaseConfirm[Value comparable](value Value) *i18n.LocalizeConfig {
×
UNCOV
114
        return &i18n.LocalizeConfig{
×
UNCOV
115
                MessageID:    "PLEASE_CONFIRM",
×
UNCOV
116
                TemplateData: value,
×
UNCOV
117
        }
×
UNCOV
118
}
×
119

120
type SayHelloParam struct {
121
        Name any
122
}
123

UNCOV
124
func (p *SayHelloParam) GetTemplateValues() map[string]any {
×
UNCOV
125
        res := make(map[string]any)
×
UNCOV
126
        if p.Name != nil {
×
UNCOV
127
                res["name"] = p.Name
×
UNCOV
128
        }
×
UNCOV
129
        return res
×
130
}
131

UNCOV
132
func NewSayHello(data *SayHelloParam) (string, map[string]any) {
×
UNCOV
133
        return "SAY_HELLO", data.GetTemplateValues()
×
UNCOV
134
}
×
135

UNCOV
136
func I18nSayHello(data *SayHelloParam) *i18n.LocalizeConfig {
×
UNCOV
137
        return &i18n.LocalizeConfig{
×
UNCOV
138
                MessageID:    "SAY_HELLO",
×
UNCOV
139
                TemplateData: data.GetTemplateValues(),
×
UNCOV
140
        }
×
UNCOV
141
}
×
142

143
func NewSuccess() string {
×
144
        return "SUCCESS"
×
145
}
×
146

UNCOV
147
func I18nSuccess() *i18n.LocalizeConfig {
×
UNCOV
148
        return &i18n.LocalizeConfig{
×
UNCOV
149
                MessageID: "SUCCESS",
×
UNCOV
150
        }
×
UNCOV
151
}
×
152

153
func NewWelcome() string {
×
154
        return "WELCOME"
×
155
}
×
156

UNCOV
157
func I18nWelcome() *i18n.LocalizeConfig {
×
UNCOV
158
        return &i18n.LocalizeConfig{
×
UNCOV
159
                MessageID: "WELCOME",
×
UNCOV
160
        }
×
UNCOV
161
}
×
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