go-fmt-func-sig

command module
v0.0.0-...-f79178a Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2019 License: MIT Imports: 10 Imported by: 0

README

go-fmt-func-sig

Formats function signatures into newlines when there are many parameters.

Example

$ diff -u foo/bar.go <(go run github.com/execjosh/go-fmt-func-sig < foo/bar.go)
--- foo/bar.go	2019-06-01 23:55:48.000000000 +0900
+++ /dev/fd/63	2019-06-02 00:14:54.000000000 +0900
@@ -10,11 +10,17 @@
 	ctx context.Context,
 	name string,
 	message string,
-	count int) (int, error) {
+	count int,
+) (int, error) {
 	return 0, nil
 }

-func notFormatted(fset *token.FileSet, fl *ast.FieldList, f *ast.File, a, b, c string) {
+func notFormatted(
+	fset *token.FileSet,
+	fl *ast.FieldList,
+	f *ast.File,
+	a, b, c string,
+) {
 }

 func alreadyFormatted(
@@ -25,4 +31,10 @@
 ) {
 }

-func finalLineInFile(fset *token.FileSet, fl *ast.FieldList, f *ast.File, a, b, c string) {}
+func finalLineInFile(
+	fset *token.FileSet,
+	fl *ast.FieldList,
+	f *ast.File,
+	a, b, c string,
+) {
+}

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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