OLD | NEW |
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 patch implements parsing and execution of the textual and | 5 // Package patch implements parsing and execution of the textual and |
6 // binary patch descriptions used by version control tools such as | 6 // binary patch descriptions used by version control tools such as |
7 // CVS, Git, Mercurial, and Subversion. | 7 // CVS, Git, Mercurial, and Subversion. |
8 package patch | 8 package patch |
9 | 9 |
10 import ( | 10 import ( |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 } | 312 } |
313 | 313 |
314 // hasPrefix returns true if s begins with t. | 314 // hasPrefix returns true if s begins with t. |
315 func hasPrefix(s []byte, t string) bool { | 315 func hasPrefix(s []byte, t string) bool { |
316 _, ok := skip(s, t) | 316 _, ok := skip(s, t) |
317 return ok | 317 return ok |
318 } | 318 } |
319 | 319 |
320 // splitLines returns the result of splitting s into lines. | 320 // splitLines returns the result of splitting s into lines. |
321 // The \n on each line is preserved. | 321 // The \n on each line is preserved. |
322 func splitLines(s []byte) [][]byte { return bytes.SplitAfter(s, newline, -1) } | 322 func splitLines(s []byte) [][]byte { return bytes.SplitAfter(s, newline) } |
OLD | NEW |