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

demdxx / gocast / 7075920251

03 Dec 2023 09:13AM UTC coverage: 80.443% (-0.2%) from 80.692%
7075920251

push

github

demdxx
Improve cast logic for nil map params + errors clarification

39 of 72 new or added lines in 5 files covered. (54.17%)

2 existing lines in 1 file now uncovered.

1234 of 1534 relevant lines covered (80.44%)

1.82 hits per line

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

71.43
/errors.go
1
package gocast
2

3
import (
4
        "errors"
5
)
6

7
type errorWrapper struct {
8
        err error
9
        msg string
10
}
11

12
func (w *errorWrapper) Error() string { return w.msg + ": " + w.err.Error() }
2✔
13
func (w *errorWrapper) Unwrap() error { return w.err }
2✔
14

15
func wrapError(err error, msg string) error {
2✔
16
        if err == nil {
2✔
NEW
17
                return nil
×
NEW
18
        }
×
19
        return &errorWrapper{err: err, msg: msg}
2✔
20
}
21

22
// Error list...
23
var (
24
        ErrInvalidParams                 = errors.New("invalid params")
25
        ErrUnsupportedType               = errors.New("unsupported destination type")
26
        ErrUnsupportedSourceType         = errors.New("unsupported source type")
27
        ErrUnsettableValue               = errors.New("can't set value")
28
        ErrUnsupportedNumericType        = errors.New("unsupported numeric type")
29
        ErrStructFieldNameUndefined      = errors.New("struct field name undefined")
30
        ErrStructFieldValueCantBeChanged = errors.New("struct field value cant be changed")
31
)
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