refactor(helper): update module path and function names
- move `helper` package files to root `helper` directory
- update all helper imports
- rename `GetLines` to `getLines` for consistent naming convention
🤖
This commit is contained in:
parent
39f1e7ae74
commit
999a4a8fa2
6 changed files with 10 additions and 8 deletions
|
@ -1,9 +1,10 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"aoc2024/helper"
|
||||
"fmt"
|
||||
"sort"
|
||||
|
||||
"aoc/helper"
|
||||
)
|
||||
|
||||
type list struct {
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"aoc2024/helper"
|
||||
"fmt"
|
||||
"sort"
|
||||
|
||||
"aoc/helper"
|
||||
)
|
||||
|
||||
type reports []report
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
module aoc2024
|
||||
|
||||
go 1.23.3
|
3
go.mod
Normal file
3
go.mod
Normal file
|
@ -0,0 +1,3 @@
|
|||
module aoc
|
||||
|
||||
go 1.23.3
|
|
@ -11,7 +11,7 @@ import (
|
|||
|
||||
const INPUT_FILE = "input"
|
||||
|
||||
func GetLines() *bufio.Scanner {
|
||||
func getLines() *bufio.Scanner {
|
||||
wd, err := os.Getwd()
|
||||
filePath := filepath.Join(wd, INPUT_FILE)
|
||||
|
||||
|
@ -24,7 +24,7 @@ func GetLines() *bufio.Scanner {
|
|||
}
|
||||
|
||||
func ReadLinesTwoIntSlices() (list_a []int, list_b []int) {
|
||||
scanner := GetLines()
|
||||
scanner := getLines()
|
||||
for scanner.Scan() {
|
||||
parts := strings.Fields(scanner.Text())
|
||||
|
||||
|
@ -39,7 +39,7 @@ func ReadLinesTwoIntSlices() (list_a []int, list_b []int) {
|
|||
}
|
||||
|
||||
func ReadLinesToIntSlices() (lines [][]int) {
|
||||
scanner := GetLines()
|
||||
scanner := getLines()
|
||||
for scanner.Scan() {
|
||||
string_line := strings.Fields(scanner.Text())
|
||||
int_line := make([]int, len(string_line))
|
Loading…
Reference in a new issue