stored line numbers in struct
This commit is contained in:
parent
abd4c60339
commit
c1c08ca71a
4
main.go
4
main.go
@ -70,9 +70,9 @@ func main() {
|
|||||||
|
|
||||||
file_lines := strings.Split(file_content, "\n")
|
file_lines := strings.Split(file_content, "\n")
|
||||||
|
|
||||||
for _, value := range file_lines {
|
for index, value := range file_lines {
|
||||||
if is_heading(value) {
|
if is_heading(value) {
|
||||||
headings = append(headings, heading{value, 0, 0})
|
headings = append(headings, heading{value, 0, (index + 1)})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user