https://github.com/eun/gomultifmt
Run multiple golang formatters in one command
https://github.com/eun/gomultifmt
go golang tool
Last synced: about 1 year ago
JSON representation
Run multiple golang formatters in one command
- Host: GitHub
- URL: https://github.com/eun/gomultifmt
- Owner: Eun
- License: mit
- Created: 2018-02-18T15:55:53.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-02-19T15:14:26.000Z (over 8 years ago)
- Last Synced: 2025-02-07T14:47:14.616Z (over 1 year ago)
- Topics: go, golang, tool
- Language: Go
- Size: 85 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# gomultifmt [](https://travis-ci.org/Eun/gomultifmt) [](https://goreportcard.com/report/github.com/Eun/gomultifmt)
Run multiple golang formatters in one command
## Installation
```
go get -u github.com/Eun/gomultifmt
```
## Usage
```
usage: gomultifmt [] [...]
Run multiple golang formatters in one command
Flags:
-h, --help Show context-sensitive help (also try --help-long and --help-man).
-f, --fmt=gofmt ... Formatter to call (sepcify it multiple times, e.g.: --fmt=gofmt --fmt=goremovelines
-w, --toSource Write result to (source) file instead of stdout
-s, --skip=DIR... ... Skip directories with this name when expanding '...'.
--vendor Enable vendoring support (skips 'vendor' directories and sets GO15VENDOREXPERIMENT=1).
-d, --debug Display debug messages.
-v, --version Show application version.
Args:
[] Directories to format. Defaults to ".". /... will recurse.
```
## Examples
### Format all files with gofmt first, and then goremovelines afterwards
```
gomultifmt --vendor --fmt=gofmt --fmt=goremovelines -w ./...
```
### Format main.go with gofmt and goremovelines, but write to stdout
```
gomultifmt --fmt=gofmt --fmt=goremovelines main.go
```
## Bonus VSCode config
"go.formatFlags": [
"--fmt=goreturns",
"--fmt=goremovelines",
],
"go.formatTool": "gomultifmt",