Skip to content

Commit

Permalink
Add urfave_cli_no_docs build tag
Browse files Browse the repository at this point in the history
This removes the resulting binary dependency on cpuguy83/md2man and
russross/blackfriday, which saves more than 400 KB (more than 300 KB
once stripped) from the resulting binary.

Document this in README.

(cherry picked from commit 49e43be)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
  • Loading branch information
kolyshkin committed May 4, 2022
1 parent ba801d7 commit fc47b1a
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@ cli is tested against multiple versions of Go on Linux, and against the latest
released version of Go on OS X and Windows. For full details, see
[`./.travis.yml`](./.travis.yml) and [`./appveyor.yml`](./appveyor.yml).

### Build tags

You can use the following build tags:

#### `urfave_cli_no_docs`

When set, this removes `ToMarkdown` and `ToMan` methods, so your application
won't be able to call those. This reduces the resulting binary size by about
300-400 KB (measured using Go 1.18.1 on Linux/amd64), due to less dependencies.

### Using `v1` releases

```
Expand Down
3 changes: 3 additions & 0 deletions docs.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build !urfave_cli_no_docs
// +build !urfave_cli_no_docs

package cli

import (
Expand Down
3 changes: 3 additions & 0 deletions docs_test.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
//go:build !urfave_cli_no_docs
// +build !urfave_cli_no_docs

package cli

import (
Expand Down

0 comments on commit fc47b1a

Please sign in to comment.