push
github
20 of 41 new or added lines in 3 files covered. (48.78%)
1802 of 2299 relevant lines covered (78.38%)
3.55 hits per line
1 |
package arrutil
|
|
2 |
|
|
3 |
import (
|
|
4 |
"strconv"
|
|
5 |
"strings"
|
|
6 |
) |
|
7 |
|
|
8 |
// Ints type
|
|
9 |
type Ints []int |
|
10 |
|
|
11 |
// String to string
|
|
NEW
|
func (is Ints) String() string { |
× |
NEW
|
ss := make([]string, len(is)) |
× |
NEW
|
for _, iv := range is { |
× |
NEW
|
ss = append(ss, strconv.Itoa(iv))
|
× |
NEW
|
} |
× |
17 |
|
|
NEW
|
return strings.Join(ss, ",") |
× |
19 |
} |
|
20 |
|
|
21 |
// Has given element
|
|
NEW
|
func (is Ints) Has(i int) bool { |
× |
NEW
|
for _, iv := range is { |
× |
NEW
|
if i == iv {
|
× |
NEW
|
return true |
× |
NEW
|
} |
× |
27 |
} |
|
NEW
|
return false |
× |
29 |
} |
|
30 |
|
|
31 |
// Strings type
|
|
32 |
type Strings []string |
|
33 |
|
|
34 |
// String to string
|
|
NEW
|
func (ss Strings) String() string { |
× |
NEW
|
return strings.Join(ss, ",") |
× |
NEW
|
} |
× |
38 |
|
|
39 |
// Has given element
|
|
NEW
|
func (ss Strings) Has(str string) bool { |
× |
NEW
|
for _, s := range ss { |
× |
NEW
|
if s == str {
|
× |
NEW
|
return true |
× |
NEW
|
} |
× |
45 |
} |
|
NEW
|
return false |
× |
47 |
} |