https://github.com/eun/goremovelines
Remove leading / trailing blank lines in Go functions, structs, if, switches, blocks.
https://github.com/eun/goremovelines
go golang hacktoberfest tool
Last synced: over 1 year ago
JSON representation
Remove leading / trailing blank lines in Go functions, structs, if, switches, blocks.
- Host: GitHub
- URL: https://github.com/eun/goremovelines
- Owner: Eun
- License: mit
- Created: 2018-02-16T14:32:37.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2025-02-17T04:27:46.000Z (over 1 year ago)
- Last Synced: 2025-02-27T05:04:06.685Z (over 1 year ago)
- Topics: go, golang, hacktoberfest, tool
- Language: Go
- Homepage:
- Size: 389 KB
- Stars: 25
- Watchers: 3
- Forks: 1
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# goremovelines
[](https://github.com/Eun/goremovelines/actions)
[](https://coveralls.io/github/Eun/goremovelines?branch=master)
[](https://pkg.go.dev/github.com/Eun/goremovelines)
[](https://goreportcard.com/report/github.com/Eun/goremovelines)
---
Remove leading / trailing blank lines in Go functions, structs, if, switches, blocks.
## Installation
```
go install github.com/Eun/goremovelines/cmd/goremovelines@latest
```
## Usage
```
usage: goremovelines [] [...]
Remove leading / trailing blank lines in Go functions, structs, if, switches, blocks.
Flags:
-h, --help Show context-sensitive help (also try --help-long and --help-man).
-r, --remove=func|struct|if|switch|case|for|interface|block ...
Remove blank lines for the context (specify it multiple times, e.g.: --remove=func --remove=struct)
-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.
```
> It is possible to combine it with gofmt/goimport/goreturns using [gomultifmt](https://github.com/Eun/gomultifmt)
```go
package main
import "fmt"
func main() {
fmt.Print("Hello")
fmt.Print("World")
}
```
**will be transformed to**
```go
package main
import "fmt"
func main() {
fmt.Print("Hello")
fmt.Print("World")
}
```
## Build History
[](https://github.com/Eun/goremovelines/actions)