gottani

package module
v0.0.0-...-2d0281a Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2022 License: BSD-2-Clause Imports: 4 Imported by: 0

README

Gottani - Combine Go source into a single .go file

What is Gottani

Gottani is a tool for combining Go source code into a single .go file.

In competitive programming, libraries are important to code solutions in a short period of time, but almost all judge environment don't have third party libraries. Many participants with Go need to do "Copy & Paste" between their library code and solution code to be submitted. This is really painful task for participants.

Gottani (ごった煮 meaning Ratatouille in Japanese) is a tool for such use cases. At first, it scans all the files in the specified directory and imported packages from there. Then it copies the functions, constants, variables and types reachable from the main function in the specified package and pastes them into a single file renaming them if needed. Finally it writes the combined source code to stdout.

Installation

# go get github.com/ktateish/gottani/cmd/gottani

Usage

The following command writes the combined source code of the specified directory to stdout.

# gottani path/to/directory

See also the examples directory.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Combine

func Combine(dir, entryPointName string) ([]byte, error)

Combine returns an application source code created by combining all functions, vars, consts, types that are reachable form the given entry point of the package in the given dir.

Types

This section is empty.

Directories

Path Synopsis
cmd
examples
01-simple
Code generated by Gottani; see https://github.com/ktateish/gottani/.
Code generated by Gottani; see https://github.com/ktateish/gottani/.
02-simple
Code generated by Gottani; see https://github.com/ktateish/gottani/.
Code generated by Gottani; see https://github.com/ktateish/gottani/.
03-simple
Code generated by Gottani; see https://github.com/ktateish/gottani/.
Code generated by Gottani; see https://github.com/ktateish/gottani/.
internal
pkginfo
pkginfo keeps package information of an application for gottani.
pkginfo keeps package information of an application for gottani.

Jump to

Keyboard shortcuts

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