elver

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 1, 2020 License: MIT Imports: 13 Imported by: 0

README

Elver

Run your Go Advent of Code solutions with a single command. Write your solution and Elver will take care of the rest.

Features

  • Automatically downloads and caches the input
  • Runs your latest solution and times it
  • 0 third party dependencies

How does it work?

Elver uses plugin build mode to generate a .so file to dynamically look up the solutions. Solutions must be in an advent folder in a main package which is required by the plugin build mode. A solution represents a day and a part and is defined as func Day[1..25][A|B]... e.g.:

// /2015/01.go
package main

import "errors"

func Day1A(input string) (interface{}, error) {
    return 42, nil
}

func Day1B(input string) (interface{}, error) {
    return nil, errors.New("Not implemented")
}

Running Elver in the root folder will generate /2015/2015.so and output the following:

$ elver
AOC 2015
Day 1 A (312ns):
42
Day 1 B (956ns):
[ERROR] Not implemented

Quick start

1. Install

$ go get github.com/aod/elver

Set your Advent of Code session token in the environment variable AOC_SESSION. This variable is used to automatically download your inputs and cache them.

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL