|
26 | 26 |
|
27 | 27 | func main() { |
28 | 28 | if err := run(os.Args[1:]); err != nil { |
29 | | - fmt.Fprintf(os.Stderr, "%v\n", err) |
| 29 | + fmt.Fprintf(os.Stderr, "error: %v\n", err) |
30 | 30 | os.Exit(1) |
31 | 31 | } |
32 | 32 | } |
@@ -83,21 +83,21 @@ func run(args []string) error { |
83 | 83 | return fmt.Errorf("parse: %v", err) |
84 | 84 | } |
85 | 85 |
|
86 | | - upMatches, downMatches := match_exact(create, destroy) |
| 86 | + upMatches, downMatches := matchExact(create, destroy) |
87 | 87 |
|
88 | 88 | msg := collectErrors(create, destroy) |
89 | 89 | if msg != "" && !fuzzyMatch { |
90 | | - return fmt.Errorf("match_exact:%v", msg) |
| 90 | + return fmt.Errorf("matchExact:%v", msg) |
91 | 91 | } |
92 | 92 |
|
93 | 93 | if fuzzyMatch && create.Size() == 0 && destroy.Size() == 0 { |
94 | | - return fmt.Errorf("required fuzzy-match but there is nothing to fuzzy") |
| 94 | + return fmt.Errorf("required fuzzy-match but there is nothing left to match") |
95 | 95 | } |
96 | 96 | if fuzzyMatch { |
97 | | - upMatches, downMatches = match_fuzzy(create, destroy) |
| 97 | + upMatches, downMatches = matchFuzzy(create, destroy) |
98 | 98 | msg := collectErrors(create, destroy) |
99 | 99 | if msg != "" { |
100 | | - return fmt.Errorf("match_fuzzy:%v", msg) |
| 100 | + return fmt.Errorf("matchFuzzy: %v", msg) |
101 | 101 | } |
102 | 102 | } |
103 | 103 |
|
@@ -179,10 +179,10 @@ func parse(rd io.Reader) (*strset.Set, *strset.Set, error) { |
179 | 179 | // |
180 | 180 | // Modify the two input sets so that they contain only the remaining (if any) unmatched elements. |
181 | 181 | // |
182 | | -// The criterium used to perform a match_exact is that one of the two elements must be a |
| 182 | +// The criterium used to perform a matchExact is that one of the two elements must be a |
183 | 183 | // prefix of the other. |
184 | 184 | // Note that the longest element could be the old or the new one, it depends on the inputs. |
185 | | -func match_exact(create, destroy *strset.Set) (map[string]string, map[string]string) { |
| 185 | +func matchExact(create, destroy *strset.Set) (map[string]string, map[string]string) { |
186 | 186 | // old -> new (or equvalenty: destroy -> create) |
187 | 187 | upMatches := map[string]string{} |
188 | 188 | downMatches := map[string]string{} |
@@ -211,18 +211,18 @@ func match_exact(create, destroy *strset.Set) (map[string]string, map[string]str |
211 | 211 | } |
212 | 212 |
|
213 | 213 | // Given two unordered sets create and destroy, that have already been processed by |
214 | | -// match_exact(), perform a fuzzy match from destroy to create. |
| 214 | +// matchExact(), perform a fuzzy match from destroy to create. |
215 | 215 | // |
216 | 216 | // Return two maps, the first that fuzzy matches each old element in destroy to the |
217 | 217 | // corresponding new element in create (up), the second that matches in the opposite |
218 | 218 | // direction (down). |
219 | 219 | // |
220 | 220 | // Modify the two input sets so that they contain only the remaining (if any) unmatched elements. |
221 | 221 | // |
222 | | -// The criterium used to perform a match_fuzzy is that one of the two elements must be a |
| 222 | +// The criterium used to perform a matchFuzzy is that one of the two elements must be a |
223 | 223 | // fuzzy match of the other, according to some definition of fuzzy. |
224 | 224 | // Note that the longest element could be the old or the new one, it depends on the inputs. |
225 | | -func match_fuzzy(create, destroy *strset.Set) (map[string]string, map[string]string) { |
| 225 | +func matchFuzzy(create, destroy *strset.Set) (map[string]string, map[string]string) { |
226 | 226 | // old -> new (or equvalenty: destroy -> create) |
227 | 227 | upMatches := map[string]string{} |
228 | 228 | downMatches := map[string]string{} |
|
0 commit comments