go-bundler

command module
v0.0.0-...-b3c9116 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2025 License: MIT Imports: 21 Imported by: 0

README

go-bundler

go-bundler is a tool written in Go for merging source files for competitive programming contests like AtCoder.

Install

go install github.com/Atnuhs/go-bundler@latest

Usage

go-bundler -dir ./path/to/your/package > bundled.go

go-bundler bundles a Go package into a single source file. By default it only emits the bundled code.

You can enable additional comment blocks with the following flags:

  -dir string
        target package directory (default ".")
  -with-metrics
        emit go-bundler metrics comment block
  -with-sustainability-metrics
        emit sustainability metrics (CO2, trees) in comment block

Example

Emit a simple bundled file:

go-bundler -dir ./cmd/app > bundled.go

Emit a bundled file with line-count metrics:

go-bundler -dir ./cmd/app -with-metrics > bundled.go

Emit a bundled file with line-count metrics and sustainability metrics:

go-bundler -dir ./cmd/app -with-metrics -with-sustainability-metrics > bundled.go

When -with-sustainability-metrics is enabled, go-bundler appends an additional metrics block that

includes a rough model-based estimate of CO2 reduction and an equivalent number of trees planted.

These values are purely illustrative and are not intended to represent actual environmental impact.

License

MIT License

Documentation

Overview

Command go-bundler bundles a Go package into a single source file, mainly for competitive programming (e.g. AtCoder).

It can optionally emit metrics and “sustainability” comment blocks (line counts, CO2 reduction estimates, and tree equivalents) in the generated source file.

Jump to

Keyboard shortcuts

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