🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

github.com/dalizard/aocutil

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/dalizard/aocutil

v0.0.0-20231202200127-29a3061b983a
Source
Go
Version published
Created
Source

Import the inputs for Advent of Code challenges straight into your code.

Fetched data is cached by default.

Usage

  • Log into Advent of Code from your browser.
  • Find your session cookie and save the value to a file (e.g. session_id).
  • Init a reader and get your input:
i, err := aocutil.NewInputFromFile("session_id")
if err != nil {
  log.Fatal(err)
}

lines, err := i.Strings(2018, 2)
if err != nil {
  log.Fatal(err)
}

// use lines

Types

func (i *Input) BigFloats(year, day int) ([]*big.Float, error)
func (i *Input) BigInts(year, day int, base int) ([]*big.Int, error)
func (i *Input) Bytes(year, day int) ([]byte, error)
func (i *Input) Floats(year, day int) ([]float64, error)
func (i *Input) Int64s(year, day int, base int) ([]int64, error)
func (i *Input) Ints(year, day int) ([]int, error)
func (i *Input) Reader(year, day int) (io.ReadCloser, error)
func (i *Input) Strings(year, day int) ([]string, error)

See godoc for more info.

FAQs

Package last updated on 02 Dec 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts