codingame-golang-merger

module
v0.0.0-...-d5f8e30 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2023 License: MIT

README

Go File Merger

Go File Merger is a command line tool that allows you to merge multiple Go source files into a single file. This can be useful in coding competitions like codingame or other situations where you are limited to a single file for your code.

Installation

Linux / Mac / WSL
git clone https://github.com/mrsombre/codingame-golang-merger.git
cd codingame-golang-merger
go build -o bin/cgmerge ./cmd/cgmerge
sudo mv bin/cgmerge /usr/local/bin/cgmerge
Example
cd example/simple
cgmerge

Usage

To use Go File Merger, navigate to the directory containing the Go source files that you want to merge. Then, use the following command:

cgmerge [--output <output_filename>] [--dir <source_directory_name>]
Options
  -d, --dir string      Source directory to parse (default ".")
  -o, --output string   Output file name (default "_merged.go")
  -h, --help            Show usage summary

Notes

  • This tool could merge only files from one directory using main package namespace and did not merge files imported from other packages.
  • This tool does not check for syntax errors, so make sure that your code is syntactically correct before merging the files.
  • The tool does not check for conflicts between files, so you need to make sure that there are no conflicts manually.
  • The tool does not delete any of the original files, so you can keep them for reference.

Contribution

If you find a bug or have an idea for a new feature, don't hesitate to open an issue or a pull request.

Directories

Path Synopsis
cmd
example

Jump to

Keyboard shortcuts

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