LEFT | RIGHT |
(no file at all) | |
1 // Copyright 2009 The Go Authors. All rights reserved. | 1 // Copyright 2009 The Go Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style | 2 // Use of this source code is governed by a BSD-style |
3 // license that can be found in the LICENSE file. | 3 // license that can be found in the LICENSE file. |
4 | 4 |
5 package main | 5 package main |
6 | 6 |
7 import ( | 7 import ( |
8 "bytes" | 8 "bytes" |
9 "container/vector" | 9 "container/vector" |
10 "exec" | 10 "exec" |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 } | 169 } |
170 } | 170 } |
171 | 171 |
172 // Finished editing files. Write the list of changed files to stdout. | 172 // Finished editing files. Write the list of changed files to stdout. |
173 list := make([]string, len(changed)) | 173 list := make([]string, len(changed)) |
174 i := 0 | 174 i := 0 |
175 for f := range changed { | 175 for f := range changed { |
176 list[i] = f | 176 list[i] = f |
177 i++ | 177 i++ |
178 } | 178 } |
179 » sort.SortStrings(list) | 179 » sort.Strings(list) |
180 for _, f := range list { | 180 for _, f := range list { |
181 fmt.Printf("%s\n", f) | 181 fmt.Printf("%s\n", f) |
182 } | 182 } |
183 } | 183 } |
184 | 184 |
185 | 185 |
186 // make parent directory for name, if necessary | 186 // make parent directory for name, if necessary |
187 func makeParent(name string) { | 187 func makeParent(name string) { |
188 parent, _ := filepath.Split(name) | 188 parent, _ := filepath.Split(name) |
189 chk(mkdirAll(parent, 0755)) | 189 chk(mkdirAll(parent, 0755)) |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 return string(bs), nil | 352 return string(bs), nil |
353 } | 353 } |
354 | 354 |
355 // A runError represents an error that occurred while running a command. | 355 // A runError represents an error that occurred while running a command. |
356 type runError struct { | 356 type runError struct { |
357 cmd []string | 357 cmd []string |
358 err os.Error | 358 err os.Error |
359 } | 359 } |
360 | 360 |
361 func (e *runError) String() string { return strings.Join(e.cmd, " ") + ": " + e.
err.String() } | 361 func (e *runError) String() string { return strings.Join(e.cmd, " ") + ": " + e.
err.String() } |
LEFT | RIGHT |