Skip to content
This repository was archived by the owner on Dec 16, 2021. It is now read-only.

Commit ee67452

Browse files
committed
gofmt -s the whole project [skip ci]
1 parent ac2de80 commit ee67452

File tree

6 files changed

+41
-41
lines changed

6 files changed

+41
-41
lines changed

app/app.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ func Run() {
7373
}
7474

7575
discord.State.MaxMessageCount = 100
76-
76+
7777
readstate.Load(discord.State)
7878

7979
isUpdateAvailable := <-updateAvailableChannel
@@ -189,7 +189,7 @@ func attemptLogin(loginScreen *ui.Login, loginMessage string, configuration *con
189189

190190
if discordError != nil {
191191
configuration.Token = ""
192-
return attemptLogin(loginScreen, fmt.Sprintf("Error during last login attempt:\n\n[red]%s", discordError), configuration);
192+
return attemptLogin(loginScreen, fmt.Sprintf("Error during last login attempt:\n\n[red]%s", discordError), configuration)
193193
}
194194

195195
readyEvent = <-readyChan

config/flags_windows.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ package config
22

33
// DisableUTF8 set to true will cause cordless to replace characters with a
44
// codepoint higher than 65536 or a runewidth of more than one character.
5-
var DisableUTF8 = true
5+
var DisableUTF8 = true

discordutil/message_test.go

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ func TestGenerateQuote(t *testing.T) {
215215
time: discordgo.Timestamp("2019-10-28T21:30:57.003000+00:00"),
216216
messageAfterQuote: "",
217217
},
218-
want: "> **humaN** 21:30:57 UTC:\n> Hello World\n",
218+
want: "> **humaN** 21:30:57 UTC:\n> Hello World\n",
219219
wantErr: false,
220220
}, {
221221
name: "simple line; non UTC - positive",
@@ -225,17 +225,17 @@ func TestGenerateQuote(t *testing.T) {
225225
time: discordgo.Timestamp("2019-10-28T21:30:57.003000+03:00"),
226226
messageAfterQuote: "",
227227
},
228-
want: "> **humaN** 18:30:57 UTC:\n> Hello World\n",
228+
want: "> **humaN** 18:30:57 UTC:\n> Hello World\n",
229229
wantErr: false,
230-
}, {
230+
}, {
231231
name: "simple line; non UTC - negative",
232232
args: args{
233233
message: "Hello World",
234234
author: "humaN",
235235
time: discordgo.Timestamp("2019-10-28T21:30:57.003000-02:00"),
236236
messageAfterQuote: "",
237237
},
238-
want: "> **humaN** 23:30:57 UTC:\n> Hello World\n",
238+
want: "> **humaN** 23:30:57 UTC:\n> Hello World\n",
239239
wantErr: false,
240240
}, {
241241
name: "multi line",
@@ -245,7 +245,7 @@ func TestGenerateQuote(t *testing.T) {
245245
time: discordgo.Timestamp("2019-10-28T21:30:57.003000+00:00"),
246246
messageAfterQuote: "",
247247
},
248-
want: "> **humaN** 21:30:57 UTC:\n> Hello World\n> Bye World\n",
248+
want: "> **humaN** 21:30:57 UTC:\n> Hello World\n> Bye World\n",
249249
wantErr: false,
250250
}, {
251251
name: "simple line with message after quote",
@@ -255,37 +255,37 @@ func TestGenerateQuote(t *testing.T) {
255255
time: discordgo.Timestamp("2019-10-28T21:30:57.003000+00:00"),
256256
messageAfterQuote: "Hei",
257257
},
258-
want: "> **humaN** 21:30:57 UTC:\n> Hello World\nHei",
258+
want: "> **humaN** 21:30:57 UTC:\n> Hello World\nHei",
259259
wantErr: false,
260-
}, {
260+
}, {
261261
name: "simple line with multline message after quote",
262262
args: args{
263263
message: "Hello World",
264264
author: "humaN",
265265
time: discordgo.Timestamp("2019-10-28T21:30:57.003000+00:00"),
266266
messageAfterQuote: "Hei\nHo",
267267
},
268-
want: "> **humaN** 21:30:57 UTC:\n> Hello World\nHei\nHo",
268+
want: "> **humaN** 21:30:57 UTC:\n> Hello World\nHei\nHo",
269269
wantErr: false,
270-
}, {
270+
}, {
271271
name: "simple line with whitespace message after quote",
272272
args: args{
273273
message: "Hello World",
274274
author: "humaN",
275275
time: discordgo.Timestamp("2019-10-28T21:30:57.003000+00:00"),
276276
messageAfterQuote: " \t ",
277277
},
278-
want: "> **humaN** 21:30:57 UTC:\n> Hello World\n",
278+
want: "> **humaN** 21:30:57 UTC:\n> Hello World\n",
279279
wantErr: false,
280-
}, {
280+
}, {
281281
name: "simple line with surrounding whitespace message after quote",
282282
args: args{
283283
message: "Hello World",
284284
author: "humaN",
285285
time: discordgo.Timestamp("2019-10-28T21:30:57.003000+00:00"),
286286
messageAfterQuote: " \t hei",
287287
},
288-
want: "> **humaN** 21:30:57 UTC:\n> Hello World\nhei",
288+
want: "> **humaN** 21:30:57 UTC:\n> Hello World\nhei",
289289
wantErr: false,
290290
}, {
291291
name: "empty author; we won't handle this, but still specify expected behaviour",
@@ -295,17 +295,17 @@ func TestGenerateQuote(t *testing.T) {
295295
time: discordgo.Timestamp("2019-10-28T21:30:57.003000+00:00"),
296296
messageAfterQuote: "",
297297
},
298-
want: "> **** 21:30:57 UTC:\n> Hello World\n> Bye World\n",
298+
want: "> **** 21:30:57 UTC:\n> Hello World\n> Bye World\n",
299299
wantErr: false,
300-
}, {
300+
}, {
301301
name: "empty message; we won't handle this, but still specify expected behaviour",
302302
args: args{
303303
message: "",
304304
author: "author",
305305
time: discordgo.Timestamp("2019-10-28T21:30:57.003000+00:00"),
306306
messageAfterQuote: "",
307307
},
308-
want: "> **author** 21:30:57 UTC:\n> \n",
308+
want: "> **author** 21:30:57 UTC:\n> \n",
309309
wantErr: false,
310310
}, {
311311
name: "Invalid timestamps should cause an error",
@@ -315,7 +315,7 @@ func TestGenerateQuote(t *testing.T) {
315315
time: discordgo.Timestamp("OwO, an invalid timestamp"),
316316
messageAfterQuote: "",
317317
},
318-
want: "",
318+
want: "",
319319
wantErr: true,
320320
},
321321
}

discordutil/users_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -499,7 +499,7 @@ func TestIsBlocked1(t *testing.T) {
499499
},
500500
},
501501
want: true,
502-
}, {
502+
}, {
503503
name: "Relation with multiple different IDs and users and one user match with wrong type",
504504
args: args{
505505
user: &discordgo.User{ID: "1"},

ui/chatview_test.go

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99
"github.com/Bios-Marcel/discordgo"
1010
)
1111

12-
func TestParseBoldAndUnderline( t *testing.T ) {
12+
func TestParseBoldAndUnderline(t *testing.T) {
1313
tests := []struct {
1414
name string
1515
input string
@@ -92,17 +92,17 @@ func TestParseBoldAndUnderline( t *testing.T ) {
9292
},
9393
}
9494
for _, tt := range tests {
95-
t.Run( tt.name, func(t *testing.T ) {
96-
if got := parseBoldAndUnderline( tt.input ); got != tt.want {
97-
t.Errorf( "ParseBoldAndUnderline() = '%v', want '%v'", got, tt.want )
95+
t.Run(tt.name, func(t *testing.T) {
96+
if got := parseBoldAndUnderline(tt.input); got != tt.want {
97+
t.Errorf("ParseBoldAndUnderline() = '%v', want '%v'", got, tt.want)
9898
}
9999
})
100100
}
101101
}
102102

103-
func TestChatView_formatMessageText( t *testing.T ) {
103+
func TestChatView_formatMessageText(t *testing.T) {
104104
defaultChatView := &ChatView{
105-
showSpoilerContent: make( map[string]bool ),
105+
showSpoilerContent: make(map[string]bool),
106106
state: &discordgo.State{},
107107
shortenLinks: false,
108108
}
@@ -194,28 +194,28 @@ func TestChatView_formatMessageText( t *testing.T ) {
194194
input: &discordgo.Message{
195195
Content: "||simple||",
196196
},
197-
want: "[" + tviewutil.ColorToHex( config.GetTheme().AttentionColor ) + "]!SPOILER![#ffffff]",
197+
want: "[" + tviewutil.ColorToHex(config.GetTheme().AttentionColor) + "]!SPOILER![#ffffff]",
198198
chatView: defaultChatView,
199199
}, {
200200
name: "simple spoiler inbetween",
201201
input: &discordgo.Message{
202202
Content: "gimme ||simple|| pls",
203203
},
204-
want: "gimme [" + tviewutil.ColorToHex( config.GetTheme().AttentionColor ) + "]!SPOILER![#ffffff] pls",
204+
want: "gimme [" + tviewutil.ColorToHex(config.GetTheme().AttentionColor) + "]!SPOILER![#ffffff] pls",
205205
chatView: defaultChatView,
206206
}, {
207207
name: "formatted spoiler inbetween",
208208
input: &discordgo.Message{
209209
Content: "gimme ||**simple**|| pls",
210210
},
211-
want: "gimme [" + tviewutil.ColorToHex( config.GetTheme().AttentionColor ) + "]!SPOILER![#ffffff] pls",
211+
want: "gimme [" + tviewutil.ColorToHex(config.GetTheme().AttentionColor) + "]!SPOILER![#ffffff] pls",
212212
chatView: defaultChatView,
213213
}, {
214214
name: "formatted spoiler inbetween",
215215
input: &discordgo.Message{
216216
Content: "gimme ||**simple**|| pls",
217217
},
218-
want: "gimme [" + tviewutil.ColorToHex( config.GetTheme().AttentionColor ) + "]!SPOILER![#ffffff] pls",
218+
want: "gimme [" + tviewutil.ColorToHex(config.GetTheme().AttentionColor) + "]!SPOILER![#ffffff] pls",
219219
chatView: defaultChatView,
220220
}, {
221221
name: "unclosed spoiler",
@@ -231,7 +231,7 @@ func TestChatView_formatMessageText( t *testing.T ) {
231231
},
232232
//FIXME Not sure whether this is correct, but it's the
233233
//current state, so i'll be specifying it for now.
234-
want: "gimme [::b][" + tviewutil.ColorToHex( config.GetTheme().AttentionColor ) + "]!SPOILER![#ffffff][::-] pls",
234+
want: "gimme [::b][" + tviewutil.ColorToHex(config.GetTheme().AttentionColor) + "]!SPOILER![#ffffff][::-] pls",
235235
chatView: defaultChatView,
236236
}, {
237237
name: "codeblock without specified langauge",
@@ -329,7 +329,7 @@ func TestChatView_formatMessageText( t *testing.T ) {
329329
input: &discordgo.Message{
330330
Content: "||```\nowo\n```||",
331331
},
332-
want: "[" + tviewutil.ColorToHex( config.GetTheme().AttentionColor ) + "]!SPOILER![#ffffff]",
332+
want: "[" + tviewutil.ColorToHex(config.GetTheme().AttentionColor) + "]!SPOILER![#ffffff]",
333333
chatView: defaultChatView,
334334
}, {
335335
name: "codeblock with revelaed spoiler around",
@@ -459,15 +459,15 @@ func TestChatView_formatMessageText( t *testing.T ) {
459459
},
460460
}
461461
for _, tt := range tests {
462-
t.Run( tt.name, func(t *testing.T ) {
463-
if got := tt.chatView.formatMessageText( tt.input ); got != tt.want {
464-
t.Errorf( "ChatView.formatMessageText() = '%v', want: '%v'", got, tt.want )
462+
t.Run(tt.name, func(t *testing.T) {
463+
if got := tt.chatView.formatMessageText(tt.input); got != tt.want {
464+
t.Errorf("ChatView.formatMessageText() = '%v', want: '%v'", got, tt.want)
465465
}
466466
})
467467
}
468468
}
469469

470-
func Test_removeLeadingWhitespaceInCode( t *testing.T ) {
470+
func Test_removeLeadingWhitespaceInCode(t *testing.T) {
471471
tests := []struct {
472472
name string
473473
code string
@@ -532,9 +532,9 @@ func Test_removeLeadingWhitespaceInCode( t *testing.T ) {
532532
},
533533
}
534534
for _, tt := range tests {
535-
t.Run( tt.name, func(t *testing.T ) {
536-
if got := removeLeadingWhitespaceInCode( tt.code ); got != tt.want {
537-
t.Errorf( "removeLeadingWhitespaceInCode() = '%v', want '%v'", got, tt.want )
535+
t.Run(tt.name, func(t *testing.T) {
536+
if got := removeLeadingWhitespaceInCode(tt.code); got != tt.want {
537+
t.Errorf("removeLeadingWhitespaceInCode() = '%v', want '%v'", got, tt.want)
538538
}
539539
})
540540
}

util/text/totp_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ func TestParseTFACode(t *testing.T) {
4949
text: "1000000",
5050
want: "",
5151
wantErr: true,
52-
}, {
52+
}, {
5353
name: "non numeric",
5454
text: "javascript is good",
5555
want: "",
5656
wantErr: true,
57-
}, {
57+
}, {
5858
name: "correct with spaces",
5959
text: " 123456 ",
6060
want: "123456",

0 commit comments

Comments
 (0)