cmd

command
v0.0.0-...-ff11b4d Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2015 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package cmd provides command line interface to gounexport tool.

Command requires package name. For, example:

gounexport github.com/dooman87/gounexport

There are next supported flags:

-exclude string
  	File with exlude patterns for objects that shouldn't be unexported.Each pattern should be started at new line. Default pattern is Test* to exclude tests methods.
-out string
  	Output file. If not set then stdout will be used
-rename
  	If set, then all defenitions that will be determined as unused will be renamed in files
-verbose
  	Turning on verbose mode

Exclude flag is pointing to file with regular expressions to ignore public unexported symbols. Each expression should be starterd with a new line. It's a standard go/regexp package. For example, below we are excluding all Test methods and everything from package public/api/pack/:

Test*
public/api/packag/*

Use -rename flag carefully and check output before.

BUG(d): The tool is not analyzing test files if package in the test file is not the same as a base package. For instance, pack/pack_test.go is in package pack_test instead of pack

Notes

Bugs

  • The tool is not analyzing test files if package in the test file is not the same as a base package. For instance, pack/pack_test.go is in package pack_test instead of pack

Jump to

Keyboard shortcuts

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