alias-generator

command module
v0.0.0-...-32c8130 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

README

alias-generator

The goal of this utility is to generate and update the alias.go files that are used through-out the Cosmos-SDK codebase.

The output is modelled on the output generated by Multitool utility.

Installation

  1. Clone this repository.
  2. Invoke go build to create a local binary. Invoke go install to install command in path.

Usage

The alias-generator has two modes: create and update.

The create command is used to create a new alias.go file in one or more packages. It will recurse through sub-packages and create aliases for any type, variable, constant or function that is not explicitly annotated with a noalias comment.

The update command will recursively search for existing alias.go files and update them.

There are two ways to prevent an entire package from being aliased:

  • Annotate the package with a // noalias comment at the top of every file
  • Remove the package from the import list in the alias.go file and update the file

Examples

create a new alias.go file for the inflation module. Will overwrite an existing file.

alias-generator create ./x/inflation

Update all alias.go files in a project. Searches recursively below current directory for files to update.

alias-generator update .

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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