gp

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2021 License: BSD-3-Clause Imports: 6 Imported by: 0

README

gp

Go Package - a tool to create go packages

Abstract

  • Create Go packages with a source code file and a test code file.
  • Additionally omit the directory hierachy for a top-level package.
  • Additionally create a command (a.k.a.) main package.
  • Additionally add a structure with a New(), and String() function.

Installation

# latest version
go install github.com/bsmr/gp/cmd/gp@latest

# specify version
go install github.com/bsmr/gp/cmd/gp@v0.0.2

# install from source
go install ./cmd/gp

Usage

# create a new package
gp -name MODULE

# to overwrite existing files
gp -name MODULE -force

# create a top-level package
gp -name MODULE -top

# create a main program
gp -name MODULE -cmd

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Version

func Version() string

Types

type Information

type Information struct {
	Name  string
	Title string
	Main  bool
	Test  bool
	Data  bool
}

func New

func New(name, title string, main, test, data bool) Information

func (Information) CreatePackage

func (i Information) CreatePackage(templateName, templateText string) (string, error)

func (Information) CreatePackageCode

func (i Information) CreatePackageCode() (string, error)

func (Information) CreatePackageTest

func (i Information) CreatePackageTest() (string, error)

Directories

Path Synopsis
cmd
gp

Jump to

Keyboard shortcuts

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