From b1dc965a4a5b8a48666749e824d0e480b9d08eed Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Thu, 19 Apr 2018 11:10:34 +0300 Subject: [PATCH] Gofmt --- debug/debug.go | 1 - interface/ui.go | 2 +- lib/ansimage/ansimage.go | 16 ++++++++-------- lib/ansimage/doc.go | 1 - lib/notification/notify_darwin.go | 6 +++--- lib/notification/notify_linux.go | 6 +++--- lib/notification/notify_windows.go | 2 +- matrix/pushrules/action_test.go | 14 +++++++------- ui/messages/tstring/cell.go | 2 +- ui/room-list.go | 2 +- ui/ui.go | 2 +- ui/view-login.go | 2 +- ui/widget/advanced-inputfield.go | 2 +- ui/widget/util.go | 2 +- 14 files changed, 29 insertions(+), 31 deletions(-) diff --git a/debug/debug.go b/debug/debug.go index 3e32125..9ed8a09 100644 --- a/debug/debug.go +++ b/debug/debug.go @@ -25,7 +25,6 @@ import ( "time" "runtime/debug" - ) var writer io.Writer diff --git a/interface/ui.go b/interface/ui.go index 731e321..cdd1927 100644 --- a/interface/ui.go +++ b/interface/ui.go @@ -67,7 +67,7 @@ type LoginView interface { type MessageDirection int const ( - AppendMessage MessageDirection = iota + AppendMessage MessageDirection = iota PrependMessage IgnoreMessage ) diff --git a/lib/ansimage/ansimage.go b/lib/ansimage/ansimage.go index 7320848..ece1f2c 100644 --- a/lib/ansimage/ansimage.go +++ b/lib/ansimage/ansimage.go @@ -102,13 +102,13 @@ func (ai *ANSImage) SetAt(y, x int, r, g, b, brightness uint8) error { func (ai *ANSImage) GetAt(y, x int) (*ANSIpixel, error) { if y >= 0 && y < ai.h && x >= 0 && x < ai.w { return &ANSIpixel{ - R: ai.pixmap[y][x].R, - G: ai.pixmap[y][x].G, - B: ai.pixmap[y][x].B, - Brightness: ai.pixmap[y][x].Brightness, - upper: ai.pixmap[y][x].upper, - source: ai.pixmap[y][x].source, - }, + R: ai.pixmap[y][x].R, + G: ai.pixmap[y][x].G, + B: ai.pixmap[y][x].B, + Brightness: ai.pixmap[y][x].Brightness, + upper: ai.pixmap[y][x].upper, + source: ai.pixmap[y][x].source, + }, nil } return nil, ErrOutOfBounds @@ -170,7 +170,7 @@ func New(h, w int, bg color.Color) (*ANSImage, error) { r, g, b, _ := bg.RGBA() ansimage := &ANSImage{ - h: h, w: w, + h: h, w: w, maxprocs: 1, bgR: uint8(r), bgG: uint8(g), diff --git a/lib/ansimage/doc.go b/lib/ansimage/doc.go index 56bc0c5..d1898a7 100644 --- a/lib/ansimage/doc.go +++ b/lib/ansimage/doc.go @@ -9,4 +9,3 @@ // // This package is licensed under the Mozilla Public License v2.0. package ansimage - diff --git a/lib/notification/notify_darwin.go b/lib/notification/notify_darwin.go index 1e09ef8..0a7e49b 100644 --- a/lib/notification/notify_darwin.go +++ b/lib/notification/notify_darwin.go @@ -42,9 +42,9 @@ func Send(title, text string, critical, sound bool) error { if sound { args = append(args, "-sound", "default") } -// if len(iconPath) > 0 { -// args = append(args, "-appIcon", iconPath) -// } + // if len(iconPath) > 0 { + // args = append(args, "-appIcon", iconPath) + // } return exec.Command("terminal-notifier", args...).Run() } title = strings.Replace(title, `"`, `\"`, -1) diff --git a/lib/notification/notify_linux.go b/lib/notification/notify_linux.go index f8ecdaf..11a37a7 100644 --- a/lib/notification/notify_linux.go +++ b/lib/notification/notify_linux.go @@ -23,9 +23,9 @@ func Send(title, text string, critical, sound bool) error { if critical { args = append(args, "-u", "critical") } -// if iconPath { -// args = append(args, "-i", iconPath) -// } + // if iconPath { + // args = append(args, "-i", iconPath) + // } args = append(args, title, text) if sound { soundName := "message-new-instant" diff --git a/lib/notification/notify_windows.go b/lib/notification/notify_windows.go index d927ee1..999380a 100644 --- a/lib/notification/notify_windows.go +++ b/lib/notification/notify_windows.go @@ -25,7 +25,7 @@ func Send(title, text string, critical, sound bool) error { Message: message, Audio: toast.Silent, Duration: toast.Short, -// Icon: ..., + // Icon: ..., } if sound { notification.Audio = toast.IM diff --git a/matrix/pushrules/action_test.go b/matrix/pushrules/action_test.go index ebdd058..41a1056 100644 --- a/matrix/pushrules/action_test.go +++ b/matrix/pushrules/action_test.go @@ -35,8 +35,8 @@ func TestPushActionArray_Should_EmptyArrayReturnsDefaults(t *testing.T) { func TestPushActionArray_Should_MixedArrayReturnsExpected1(t *testing.T) { should := pushrules.PushActionArray{ {Action: pushrules.ActionNotify}, - {Action: pushrules.ActionSetTweak, Tweak: pushrules.TweakHighlight }, - {Action: pushrules.ActionSetTweak, Tweak: pushrules.TweakSound, Value: "ping" }, + {Action: pushrules.ActionSetTweak, Tweak: pushrules.TweakHighlight}, + {Action: pushrules.ActionSetTweak, Tweak: pushrules.TweakSound, Value: "ping"}, }.Should() assert.True(t, should.NotifySpecified) assert.True(t, should.Notify) @@ -49,7 +49,7 @@ func TestPushActionArray_Should_MixedArrayReturnsExpected2(t *testing.T) { should := pushrules.PushActionArray{ {Action: pushrules.ActionDontNotify}, {Action: pushrules.ActionSetTweak, Tweak: pushrules.TweakHighlight, Value: false}, - {Action: pushrules.ActionSetTweak, Tweak: pushrules.TweakSound, Value: "" }, + {Action: pushrules.ActionSetTweak, Tweak: pushrules.TweakSound, Value: ""}, }.Should() assert.True(t, should.NotifySpecified) assert.False(t, should.Notify) @@ -92,7 +92,7 @@ func TestPushActionArray_Should_DontNotify(t *testing.T) { func TestPushActionArray_Should_HighlightBlank(t *testing.T) { should := pushrules.PushActionArray{ - {Action: pushrules.ActionSetTweak, Tweak: pushrules.TweakHighlight }, + {Action: pushrules.ActionSetTweak, Tweak: pushrules.TweakHighlight}, }.Should() assert.False(t, should.NotifySpecified) assert.False(t, should.Notify) @@ -103,7 +103,7 @@ func TestPushActionArray_Should_HighlightBlank(t *testing.T) { func TestPushActionArray_Should_HighlightFalse(t *testing.T) { should := pushrules.PushActionArray{ - {Action: pushrules.ActionSetTweak, Tweak: pushrules.TweakHighlight, Value: false }, + {Action: pushrules.ActionSetTweak, Tweak: pushrules.TweakHighlight, Value: false}, }.Should() assert.False(t, should.NotifySpecified) assert.False(t, should.Notify) @@ -114,7 +114,7 @@ func TestPushActionArray_Should_HighlightFalse(t *testing.T) { func TestPushActionArray_Should_SoundName(t *testing.T) { should := pushrules.PushActionArray{ - {Action: pushrules.ActionSetTweak, Tweak: pushrules.TweakSound, Value: "ping" }, + {Action: pushrules.ActionSetTweak, Tweak: pushrules.TweakSound, Value: "ping"}, }.Should() assert.False(t, should.NotifySpecified) assert.False(t, should.Notify) @@ -125,7 +125,7 @@ func TestPushActionArray_Should_SoundName(t *testing.T) { func TestPushActionArray_Should_SoundNameEmpty(t *testing.T) { should := pushrules.PushActionArray{ - {Action: pushrules.ActionSetTweak, Tweak: pushrules.TweakSound, Value: "" }, + {Action: pushrules.ActionSetTweak, Tweak: pushrules.TweakSound, Value: ""}, }.Should() assert.False(t, should.NotifySpecified) assert.False(t, should.Notify) diff --git a/ui/messages/tstring/cell.go b/ui/messages/tstring/cell.go index 8a400ee..c3e22a3 100644 --- a/ui/messages/tstring/cell.go +++ b/ui/messages/tstring/cell.go @@ -17,8 +17,8 @@ package tstring import ( - "maunium.net/go/tcell" "github.com/mattn/go-runewidth" + "maunium.net/go/tcell" ) type Cell struct { diff --git a/ui/room-list.go b/ui/room-list.go index b85ed24..5f59136 100644 --- a/ui/room-list.go +++ b/ui/room-list.go @@ -20,9 +20,9 @@ import ( "fmt" "strconv" - "maunium.net/go/tcell" "maunium.net/go/gomuks/matrix/rooms" "maunium.net/go/gomuks/ui/widget" + "maunium.net/go/tcell" "maunium.net/go/tview" ) diff --git a/ui/ui.go b/ui/ui.go index 75fd8bf..ffd6fc6 100644 --- a/ui/ui.go +++ b/ui/ui.go @@ -17,8 +17,8 @@ package ui import ( - "maunium.net/go/tcell" "maunium.net/go/gomuks/interface" + "maunium.net/go/tcell" "maunium.net/go/tview" ) diff --git a/ui/view-login.go b/ui/view-login.go index 8343aaa..46e1903 100644 --- a/ui/view-login.go +++ b/ui/view-login.go @@ -18,8 +18,8 @@ package ui import ( "maunium.net/go/gomuks/config" - "maunium.net/go/gomuks/interface" "maunium.net/go/gomuks/debug" + "maunium.net/go/gomuks/interface" "maunium.net/go/gomuks/ui/widget" "maunium.net/go/tview" ) diff --git a/ui/widget/advanced-inputfield.go b/ui/widget/advanced-inputfield.go index 7e01478..cbe9dcc 100644 --- a/ui/widget/advanced-inputfield.go +++ b/ui/widget/advanced-inputfield.go @@ -24,9 +24,9 @@ import ( "strings" "unicode/utf8" - "maunium.net/go/tcell" "github.com/mattn/go-runewidth" "github.com/zyedidia/clipboard" + "maunium.net/go/tcell" "maunium.net/go/tview" ) diff --git a/ui/widget/util.go b/ui/widget/util.go index 920afad..dd94bdd 100644 --- a/ui/widget/util.go +++ b/ui/widget/util.go @@ -17,8 +17,8 @@ package widget import ( - "maunium.net/go/tcell" "github.com/mattn/go-runewidth" + "maunium.net/go/tcell" "maunium.net/go/tview" )