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

goto / guardian / 5804509431

09 Aug 2023 03:20AM UTC coverage: 75.657% (-0.4%) from 76.038%
5804509431

Pull #56

github

rahmatrhd
fix: mark grant.IsPermanent as false when updating the exp date
Pull Request #56: feat: grant dormancy check

407 of 407 new or added lines in 16 files covered. (100.0%)

8376 of 11071 relevant lines covered (75.66%)

4.22 hits per line

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

66.67
/utils/struct.go
1
package utils
2

3
import "encoding/json"
4

5
// StructToMap converts a struct to a map using json marshalling
6
func StructToMap(v interface{}) (map[string]interface{}, error) {
3✔
7
        result := map[string]interface{}{}
3✔
8

3✔
9
        if v != nil {
5✔
10
                jsonString, err := json.Marshal(v)
2✔
11
                if err != nil {
2✔
12
                        return nil, err
×
13
                }
×
14

15
                if err := json.Unmarshal(jsonString, &result); err != nil {
2✔
16
                        return nil, err
×
17
                }
×
18
        }
19

20
        return result, nil
3✔
21
}
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