representer

package module
v0.0.0-...-6518cbc Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2025 License: AGPL-3.0 Imports: 3 Imported by: 0

README

Exercism's Go Representer

This is Exercism's representer for the Go track. See the docs for more information on representers.

Build Executable

This will create an executable called represent.

go build -tags build -o represent .

Executing the Representer

The representer takes three arguments:

  • The slug of the exercise (e.g. two-fer).
  • A path to a directory containing the submitted file(s) (with a trailing slash).
  • A path to an output directory (with a trailing slash). This directory is writable.

The representer will write a representation.txt and mapping.json file to the output directory.

With the binary built above:

represent two-fer ./representer/testdata/two-fer/1/ ./

Current Normalizations

The basic normalizations recommended in the docs are implemented.

  • Use placeholders for variable names
  • Remove comments
  • Apply standard formatting
  • Consolidate multiple files
  • Sort top level declarations (imports, types, constants, variables, functions)

Batch Analysis

See Batch Analysis README for information on how to run the representer on a bigger data set.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Extract

func Extract(solutionPath string) ([]byte, []byte, error)

Extract extracts and returns the representation and mapping from given solution path.

Types

This section is empty.

Directories

Path Synopsis
cmd
representer command

Jump to

Keyboard shortcuts

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