Hey y’all! Brand new to Golang — I’m setting out to learn a bit by using it (along with Python) to complete this year’s Advent of Code puzzles.
TL;DR: How can I compose my directory in such a way that I can reuse some functions in all of my day’s answers?
I have a folder going like
. ├── day_1 │ ├── data.txt │ ├── solution.go │ └── solution.py └── day_2 ├── data.txt ├── solution.go └── solution.py
to house all of my solutions.
Say I wanted to create some
utilities folder at the top level (same level as the
day_n folders ) to do common things like read the puzzle input into an array, or error check. How would I import those functions into each day’s
solution.go file? Is this possible with the way I have my directory set up? I saw some resources about modules and packages and setting up a
/src directory and… well, coming from Python, I’m a little lost.