Skip to content

Commit fd39388

Browse files
author
andrey
committed
Change type [][]int to [][2]int
1 parent 2464a0d commit fd39388

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mfd/files.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ func replaceFragmentInFile(output, findData, newData, pattern string) (bool, err
246246
}
247247

248248
// extractFragments returned array with coordinates start and end text
249-
func extractFragments(pattern string, lines []string) ([][]int, error) {
249+
func extractFragments(pattern string, lines []string) ([][2]int, error) {
250250
var (
251251
reFragments [][2]int
252252
start = -1
@@ -273,7 +273,7 @@ func extractFragments(pattern string, lines []string) ([][]int, error) {
273273
return nil, fmt.Errorf("no reFragments found with pattern: %s", pattern)
274274
}
275275

276-
var ff [][]int
276+
var ff [][2]int
277277

278278
// split big fragment
279279
for _, fragment := range reFragments {
@@ -282,7 +282,7 @@ func extractFragments(pattern string, lines []string) ([][]int, error) {
282282

283283
for i, line := range ll {
284284
if line == "}" {
285-
ff = append(ff, []int{subStart, fragment[0] + i + 1})
285+
ff = append(ff, [2]int{subStart, fragment[0] + i + 1})
286286
subStart = fragment[0] + i + 1
287287
}
288288
}

0 commit comments

Comments
 (0)