Skip to content

Commit 6317de0

Browse files
committed
[chore] Fix mage fmt and reformat code
This commit fixes `mage fmt` and reformat the code.
1 parent 85c4858 commit 6317de0

File tree

15 files changed

+41
-27
lines changed

15 files changed

+41
-27
lines changed

api/npipe/listener_windows_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ import (
2424
"net/http"
2525
"testing"
2626

27-
"github.com/elastic/elastic-agent-libs/transport/httpcommon"
2827
"github.com/stretchr/testify/assert"
2928
"github.com/stretchr/testify/require"
29+
30+
"github.com/elastic/elastic-agent-libs/transport/httpcommon"
3031
)
3132

3233
func TestHTTPOverNamedPipe(t *testing.T) {

dev-tools/mage/benchmark.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ import (
2828
"strconv"
2929
"strings"
3030

31-
"github.com/elastic/elastic-agent-libs/dev-tools/mage/gotool"
3231
"github.com/magefile/mage/mg"
3332
"github.com/magefile/mage/sh"
33+
34+
"github.com/elastic/elastic-agent-libs/dev-tools/mage/gotool"
3435
)
3536

3637
const (

dev-tools/mage/fmt.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ import (
3131

3232
const (
3333
// GoImportsImportPath controls the import path used to install goimports.
34-
GoImportsImportPath = "golang.org/x/tools/cmd/goimports"
34+
GoImportsImportPath = "golang.org/x/tools/cmd/goimports@latest"
3535

3636
// GoImportsLocalPrefix is a string prefix matching imports that should be
3737
// grouped after third-party packages.

helpers/windows/pdh/zpdh_windows.go

Lines changed: 6 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

logp/configure/logging_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ package configure
2020
import (
2121
"testing"
2222

23+
"github.com/stretchr/testify/require"
24+
2325
"github.com/elastic/elastic-agent-libs/config"
2426
"github.com/elastic/elastic-agent-libs/logp"
25-
"github.com/stretchr/testify/require"
2627
)
2728

2829
func TestLoggerOutputEnvironment(t *testing.T) {

logp/logptest/logptest.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,12 @@ package logptest
2020
import (
2121
"testing"
2222

23-
"github.com/elastic/elastic-agent-libs/logp"
2423
"go.uber.org/zap"
2524
"go.uber.org/zap/zapcore"
2625
"go.uber.org/zap/zaptest"
2726
"go.uber.org/zap/zaptest/observer"
27+
28+
"github.com/elastic/elastic-agent-libs/logp"
2829
)
2930

3031
// NewTestingLogger returns a testing suitable logp.Logger.

monitoring/metrics_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ func TestSafeVars(t *testing.T) {
144144
})
145145
wg.Wait()
146146
})
147-
147+
148148
t.Run("NewTimestamp", func(t *testing.T) {
149149
reg := NewRegistry()
150150
name := "foo"

periodic/ratelimited_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ import (
2727
"testing"
2828
"time"
2929

30-
"github.com/elastic/elastic-agent-libs/iobuf"
3130
"github.com/stretchr/testify/assert"
3231
"github.com/stretchr/testify/require"
32+
33+
"github.com/elastic/elastic-agent-libs/iobuf"
3334
)
3435

3536
type syncBuffer struct {

processors/dissect/delimiter.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"strings"
2323
)
2424

25-
//delimiter represents a text section after or before a key, it keeps track of the needle and allows
25+
// delimiter represents a text section after or before a key, it keeps track of the needle and allows
2626
// to retrieve the position where it starts from a haystack.
2727
type delimiter interface {
2828
// IndexOf receives the haystack and a offset position and will return the absolute position where

processors/dissect/field.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ func (f baseField) String() string {
114114
// dissect: %{key}
115115
// message: hello
116116
// result:
117+
//
117118
// key: hello
118119
type normalField struct {
119120
baseField
@@ -129,6 +130,7 @@ func (f normalField) Apply(b string, m Map) {
129130
// dissect: %{} %{key}
130131
// message: hello world
131132
// result:
133+
//
132134
// key: world
133135
type skipField struct {
134136
baseField
@@ -147,6 +149,7 @@ func (f skipField) IsSaveable() bool {
147149
// dissect: %{?key} %{&key}
148150
// message: hello world
149151
// result:
152+
//
150153
// hello: world
151154
//
152155
// Deprecated: see pointerField
@@ -182,6 +185,7 @@ func (f pointerField) IsSaveable() bool {
182185
// dissect: %{?key} %{&key}
183186
// message: hello world
184187
// result:
188+
//
185189
// hello: world
186190
type indirectField struct {
187191
baseField
@@ -201,11 +205,13 @@ func (f indirectField) Apply(b string, m Map) {
201205
// dissect: %{+key} %{+key}
202206
// message: hello world
203207
// result:
208+
//
204209
// key: hello world
205210
//
206211
// dissect: %{+key/2} %{+key/1}
207212
// message: hello world
208213
// result:
214+
//
209215
// key: world hello
210216
type appendField struct {
211217
baseField

0 commit comments

Comments
 (0)