OLD | NEW |
1 package types | 1 package types |
2 | 2 |
3 // Label for classifying digests. | 3 // Label for classifying digests. |
4 type Label int | 4 type Label int |
5 | 5 |
6 const ( | 6 const ( |
7 // Primary key field that uniquely identifies a key. | 7 // Primary key field that uniquely identifies a key. |
8 PRIMARY_KEY_FIELD = "name" | 8 PRIMARY_KEY_FIELD = "name" |
| 9 ) |
9 | 10 |
| 11 // Note: Some code in analysis depends on the order of this enum and |
| 12 // also on UNTRIAGED being 0. |
| 13 const ( |
10 // Classifications for observed digests. | 14 // Classifications for observed digests. |
11 » UNTRIAGED Label = iota | 15 » UNTRIAGED Label = iota // == 0 |
12 POSITIVE | 16 POSITIVE |
13 NEGATIVE | 17 NEGATIVE |
14 ) | 18 ) |
15 | 19 |
16 // Stores the digests and their associated labels. | 20 // Stores the digests and their associated labels. |
17 // Note: The name of the test is assumed to be handled by the client of this | 21 // Note: The name of the test is assumed to be handled by the client of this |
18 // type. Most likely in the keys of a map. | 22 // type. Most likely in the keys of a map. |
19 type TestClassification map[string]Label | 23 type TestClassification map[string]Label |
20 | 24 |
21 func (tc TestClassification) DeepCopy() TestClassification { | 25 func (tc TestClassification) DeepCopy() TestClassification { |
22 result := make(map[string]Label, len(tc)) | 26 result := make(map[string]Label, len(tc)) |
23 for k, v := range tc { | 27 for k, v := range tc { |
24 result[k] = v | 28 result[k] = v |
25 } | 29 } |
26 return result | 30 return result |
27 } | 31 } |
OLD | NEW |