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

SwissDataScienceCenter / renku-gateway / 8707497976

16 Apr 2024 02:31PM UTC coverage: 50.644%. First build
8707497976

Pull #696

gihub-action

olevski
chore: address comments\
Pull Request #696: feat!: login refactor

1369 of 2755 new or added lines in 32 files covered. (49.69%)

1534 of 3029 relevant lines covered (50.64%)

11.08 hits per line

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

92.0
/internal/models/serializable_string_slice.go
1
package models
2

3
import "encoding/json"
4

5
// SerializableStringSlice is a string slice that can be marshalled to a json representation
6
// of a string slice and also unmarshalled back into a list of strings from a json string.
7
type SerializableStringSlice []string
8

9
func (s SerializableStringSlice) MarshalBinary() (data []byte, err error) {
1✔
10
        return json.Marshal(s)
1✔
11
}
1✔
12

13
func (s *SerializableStringSlice) UnmarshalBinary(data []byte) error {
1✔
14
        return json.Unmarshal(data, s)
1✔
15
}
1✔
16

17
func (s SerializableStringSlice) MarshalText() (data []byte, err error) {
1✔
18
        return json.Marshal(s)
1✔
19
}
1✔
20

21
func (s *SerializableStringSlice) UnmarshalText(data []byte) error {
1✔
22
        return json.Unmarshal(data, s)
1✔
23
}
1✔
24

25
func (s SerializableStringSlice) MarshalJSON() (data []byte, err error) {
3✔
26
        // Marshal to JSON same as []string
3✔
27
        return json.Marshal([]string(s))
3✔
28
}
3✔
29

30
func (s *SerializableStringSlice) UnmarshalJSON(data []byte) error {
3✔
31
        // Unmarshal to json same as []string
3✔
32
        var res []string
3✔
33
        err := json.Unmarshal(data, &res)
3✔
34
        if err != nil {
3✔
NEW
35
                return err
×
NEW
36
        }
×
37
        *s = res
3✔
38
        return nil
3✔
39
}
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