So I know this won’t get you all the way to a solution to your problem, but the below code would be how you could open a file and then read it line by line. I’m not sure how you would scan two file at the same time, but you could possibly read each file into a slice of strings where each index would be a line.
Then it would be easier to work with these two []string and compare each index to each other. It’s pretty inefficient because you need to allocate two slices and then loop over them, but if it’s good enough for your use case it could work
file, err := os.Open("file1.txt")
if err != nil {
panic(err)
}
scanner := bufio.NewScanner(file)
var file1Lines []string
for scanner.Scan() {
currentLineText := scanner.Text()
file1Lines = append(file1Lines, currentLineText)
}