diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2020-12-02 13:23:25 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2020-12-03 13:12:58 +0100 |
commit | d90e37e0c6e812f9913bf256c9c81aa05b7a08aa (patch) | |
tree | 7b1b14464eefec1188ca2eed53c64e4823453cc9 /helpers/emoji_test.go | |
parent | 32471b57bde51c55a15dbf1db75d6e5f7232c347 (diff) |
all: Format code with gofumpt
See https://github.com/mvdan/gofumpt
Diffstat (limited to 'helpers/emoji_test.go')
-rw-r--r-- | helpers/emoji_test.go | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/helpers/emoji_test.go b/helpers/emoji_test.go index 89f9df5fa..e9d634ccc 100644 --- a/helpers/emoji_test.go +++ b/helpers/emoji_test.go @@ -74,7 +74,6 @@ func TestEmojiCustom(t *testing.T) { // Hugo have a byte slice, wants a byte slice and doesn't mind if the original is modified. func BenchmarkEmojiKyokomiFprint(b *testing.B) { - f := func(in []byte) []byte { buff := bufferpool.GetBuffer() defer bufferpool.PutBuffer(buff) @@ -89,7 +88,6 @@ func BenchmarkEmojiKyokomiFprint(b *testing.B) { } func BenchmarkEmojiKyokomiSprint(b *testing.B) { - f := func(in []byte) []byte { return []byte(emoji.Sprint(string(in))) } @@ -102,7 +100,6 @@ func BenchmarkHugoEmoji(b *testing.B) { } func doBenchmarkEmoji(b *testing.B, f func(in []byte) []byte) { - type input struct { in []byte expect []byte @@ -119,8 +116,8 @@ func doBenchmarkEmoji(b *testing.B, f func(in []byte) []byte) { {"No smiles for you or " + strings.Repeat("you ", 1000), "No smiles for you or " + strings.Repeat("you ", 1000)}, } - var in = make([]input, b.N*len(data)) - var cnt = 0 + in := make([]input, b.N*len(data)) + cnt := 0 for i := 0; i < b.N; i++ { for _, this := range data { in[cnt] = input{[]byte(this.input), []byte(this.expect)} @@ -142,6 +139,5 @@ func doBenchmarkEmoji(b *testing.B, f func(in []byte) []byte) { b.Fatalf("[%d] emoji std, got \n%q but expected \n%q", j, result, currIn.expect) } } - } } |