Thanks to visit codestin.com
Credit goes to github.com

Skip to content

JohnBra/aoc-golang

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

99 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advent of Code - Go

Using advent of code to familiarize myself with golang.

Usage

  1. Get your inputs for each day on the official website and add them to the respective <year>/<day> directory.
  2. go run ./<year>/<day>/ -input=<path to puzzle input>
  3. The answers will be printed out on the command line

Inputs are in .gitignore to not expose them as requested by the Advent of Code guy.

Personal notes

I/O

  • I/O benchmarking blog post. Interesting read on bufio.Scanner vs os.ReadFile. Gist: bufio.Scanner is less performant than os.ReadFile but can read line by line.
  • To read a whole file it can be better to use os.ReadFile like in this Stack Overflow answer.
  • scanner throws error if line > 65536 characters by default. Configue according to Scanner.Buffer API.

Benchmarking & Testing

  • Benchmarking api.
  • Benchmarking funcs measure the whole function, not just the loop. Reset timer after expensive set up
  • Blog post on testing and benchmarking.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages