Skip to content

V3

Choose a tag to compare

@marcos-venicius marcos-venicius released this 01 Dec 00:20
· 1 commit to main since this release

AocReader

This lib is a helper to my aoc solutions.

Mocking

This method allows you to pass an array as the lines of a file

import "github.com/marcos-venicius/aocreader"

lines := []string{
  "line 1",
  "...",
}

reader := aocreader.NewMockReader(lines)

for reader.Running() {
    i, line := reader.Line()

    ...
}

Using

This method allows you to pass the path to a file where you want to read the lines

import "github.com/marcos-venicius/aocreader"

reader := aocreader.NewAocReader("./input.txt")

for reader.Running() {
    i, line := reader.Line()

    ...
}

Full Changelog: v2...v3