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

goto / guardian / 5781074449

07 Aug 2023 04:35AM UTC coverage: 73.901% (-2.1%) from 76.038%
5781074449

Pull #56

github

rahmatrhd
fix: check required private log viewer permission
Pull Request #56: feat: grant dormancy check

413 of 413 new or added lines in 15 files covered. (100.0%)

8186 of 11077 relevant lines covered (73.9%)

4.13 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