gma

command module
v0.0.0-...-1e71931 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2021 License: MIT Imports: 6 Imported by: 0

README

gma (go-main-aggregator)

gma provide feature makes an aggregated main file from main and dependencies files.

Usecase

A most powerful use case is competitive programming. Generally, competitive programming should submit to a single file. You can isolate the main(solver) and common utility files via using gma.

Installation

go get github.com/takashabe/gma

require go1.11 or later and GO111MODULE environemnts

Usage

gma -main main.go -depends util.go,util2.go -depends util/util.go
Options
-main    require: the central file of aggregation
-depends optional: dependencies files
Example

files to use:

  • main.go
package main

import (
  "fmt"

  "github.com/takashabe/gma/example/util"
)

func main() {
  fmt.Println(util.Name)
  fmt.Println(util.Foo())
  Foo()
}
  • util.go
package main

func Foo() {}
  • util/util.go
package util

import "fmt"

const Name = "util.go"

func Foo() string {
  return fmt.Sprintf("util")
}

execute gma:

$ gma -main example/main.go -depends example/util.go -depends example/util/util.go
package main

import (
  "fmt"
)

func main() {
  fmt.Println(_util_Foo())
  Foo()
}
func Foo() {
}
func _util_Foo() string {
  return fmt.Sprintf("util")
}

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

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