From fb2359a8c0fb6645ea0a67bf6c60b8b81b4dbc12 Mon Sep 17 00:00:00 2001 From: Koichi Shiraishi Date: Thu, 18 Aug 2022 08:02:53 +0900 Subject: [PATCH] all: also format by gofumpt@v0.3.1 Signed-off-by: Koichi Shiraishi --- msgpack/encode.go | 3 ++- msgpack/rpc/rpc.go | 1 - nvim/api_test.go | 8 ++++---- nvim/api_tool.go | 2 +- nvim/plugin/main.go | 2 +- nvim/plugin/manifest_test.go | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/msgpack/encode.go b/msgpack/encode.go index 22ba89d0..6174c001 100644 --- a/msgpack/encode.go +++ b/msgpack/encode.go @@ -381,7 +381,8 @@ func (b *encodeBuilder) structEncoder(t reflect.Type) encodeFunc { name: f.name, empty: empty, index: f.index, - f: encoderForType(f.typ, b)} + f: encoderForType(f.typ, b), + } } if array { diff --git a/msgpack/rpc/rpc.go b/msgpack/rpc/rpc.go index bc9e68a6..c974d209 100644 --- a/msgpack/rpc/rpc.go +++ b/msgpack/rpc/rpc.go @@ -148,7 +148,6 @@ func NewEndpoint(r io.Reader, w io.Writer, c io.Closer, options ...Option) (*End option.f(e) } return e, nil - } func (e *Endpoint) decodeUint(what string) (uint64, error) { diff --git a/nvim/api_test.go b/nvim/api_test.go index dd2dfcea..af2840b9 100644 --- a/nvim/api_test.go +++ b/nvim/api_test.go @@ -3621,7 +3621,7 @@ func testHighlight(v *Nvim) func(*testing.T) { } const HLIDName = `PreProc` - var wantErrorHLID = 85 + wantErrorHLID := 85 if nvimVersion.Minor >= 8 { wantErrorHLID += 3 } @@ -3729,7 +3729,7 @@ func testHighlight(v *Nvim) func(*testing.T) { } const HLIDName = `PreProc` - var wantErrorHLID = 85 + wantErrorHLID := 85 if nvimVersion.Minor >= 8 { wantErrorHLID += 3 } @@ -4495,7 +4495,7 @@ func testPutPaste(v *Nvim) func(*testing.T) { if err != nil { t.Fatal(err) } - var want = "!foobarbaz!" + want := "!foobarbaz!" if nvimVersion.Minor >= 7 { want = "!!foobarbaz" } @@ -4526,7 +4526,7 @@ func testPutPaste(v *Nvim) func(*testing.T) { if err := b.Execute(); err != nil { t.Fatal(err) } - var want = "!foobarbaz!" + want := "!foobarbaz!" if nvimVersion.Minor >= 7 { want = "!!foobarbaz" } diff --git a/nvim/api_tool.go b/nvim/api_tool.go index 87ed02b1..3e7f6c83 100644 --- a/nvim/api_tool.go +++ b/nvim/api_tool.go @@ -405,7 +405,7 @@ func printImplementation(functions []*Function, tmpl *template.Template, outFile } if outFile != "" { - return ioutil.WriteFile(outFile, out, 0666) + return ioutil.WriteFile(outFile, out, 0o666) } _, err = os.Stdout.Write(out) return err diff --git a/nvim/plugin/main.go b/nvim/plugin/main.go index c18ce864..e34e8ab3 100644 --- a/nvim/plugin/main.go +++ b/nvim/plugin/main.go @@ -76,7 +76,7 @@ func overwriteManifest(path, host string, manifest []byte) error { return err } output := replaceManifest(host, input, manifest) - return ioutil.WriteFile(path, output, 0666) + return ioutil.WriteFile(path, output, 0o666) } func replaceManifest(host string, input, manifest []byte) []byte { diff --git a/nvim/plugin/manifest_test.go b/nvim/plugin/manifest_test.go index 5dca1aa2..ff39bec1 100644 --- a/nvim/plugin/manifest_test.go +++ b/nvim/plugin/manifest_test.go @@ -13,7 +13,7 @@ const ( func TestReplaceManifest(t *testing.T) { t.Parallel() - var replaceManifestTests = []struct { + replaceManifestTests := []struct { name string original string expected string