From 895d73f311b05279f359793a6bddbeacc12b90ff Mon Sep 17 00:00:00 2001 From: Shaunak Kashyap Date: Thu, 9 Mar 2023 15:13:52 -0500 Subject: [PATCH] Undoing trivial formatting changes --- dev-tools/mage/gotest_test.go | 1 + internal/pkg/agent/errors/error.go | 3 +-- internal/pkg/composable/context.go | 3 +-- internal/pkg/composable/dynamic.go | 3 +-- internal/pkg/composable/testing/dynamic.go | 6 ++---- internal/pkg/fleetapi/ack_cmd.go | 2 -- internal/pkg/fleetapi/enroll_cmd.go | 2 -- internal/pkg/remote/client.go | 1 - 8 files changed, 6 insertions(+), 15 deletions(-) diff --git a/dev-tools/mage/gotest_test.go b/dev-tools/mage/gotest_test.go index 2587b4a0919..c7a0ca6ba5a 100644 --- a/dev-tools/mage/gotest_test.go +++ b/dev-tools/mage/gotest_test.go @@ -40,6 +40,7 @@ var gotestHelperMode = os.Getenv(envGoTestHelper) == "1" // // // sample test // } +// func TestGoTest_CaptureOutput(t *testing.T) { errNonZero := "go test returned a non-zero value" makeArgs := func(test string) GoTestArgs { diff --git a/internal/pkg/agent/errors/error.go b/internal/pkg/agent/errors/error.go index 394eeae7cf1..03a4942c2f4 100644 --- a/internal/pkg/agent/errors/error.go +++ b/internal/pkg/agent/errors/error.go @@ -2,9 +2,8 @@ // or more contributor license agreements. Licensed under the Elastic License; // you may not use this file except in compliance with the Elastic License. -// Package errors provides a small api to manage hierarchy of errors. -// //nolint:errorlint,errcheck // Postpone the change here until we refactor error handling. +// Package errors provides a small api to manage hierarchy of errors. package errors import ( diff --git a/internal/pkg/composable/context.go b/internal/pkg/composable/context.go index 9cf448c6b51..3a805efd249 100644 --- a/internal/pkg/composable/context.go +++ b/internal/pkg/composable/context.go @@ -24,9 +24,8 @@ func (r *providerRegistry) MustAddContextProvider(name string, builder ContextPr } } -// AddContextProvider adds a new ContextProviderBuilder -// //nolint:dupl,goimports,nolintlint // false positive +// AddContextProvider adds a new ContextProviderBuilder func (r *providerRegistry) AddContextProvider(name string, builder ContextProviderBuilder) error { r.lock.Lock() defer r.lock.Unlock() diff --git a/internal/pkg/composable/dynamic.go b/internal/pkg/composable/dynamic.go index 7d031b6d9c8..22ff438fe71 100644 --- a/internal/pkg/composable/dynamic.go +++ b/internal/pkg/composable/dynamic.go @@ -44,9 +44,8 @@ func (r *providerRegistry) MustAddDynamicProvider(name string, builder DynamicPr } } -// AddDynamicProvider adds a new DynamicProviderBuilder -// //nolint:dupl,goimports,nolintlint // false positive +// AddDynamicProvider adds a new DynamicProviderBuilder func (r *providerRegistry) AddDynamicProvider(providerName string, builder DynamicProviderBuilder) error { r.lock.Lock() defer r.lock.Unlock() diff --git a/internal/pkg/composable/testing/dynamic.go b/internal/pkg/composable/testing/dynamic.go index 659c98fb69c..99b499835cd 100644 --- a/internal/pkg/composable/testing/dynamic.go +++ b/internal/pkg/composable/testing/dynamic.go @@ -81,9 +81,8 @@ func (t *DynamicComm) Previous(id string) (DynamicState, bool) { return prev, ok } -// PreviousIDs returns the previous set mapping ID. -// //nolint:prealloc,goimports,nolintlint // false positive +// PreviousIDs returns the previous set mapping ID. func (t *DynamicComm) PreviousIDs() []string { t.lock.Lock() defer t.lock.Unlock() @@ -102,9 +101,8 @@ func (t *DynamicComm) Current(id string) (DynamicState, bool) { return curr, ok } -// CurrentIDs returns the current set mapping ID. -// //nolint:prealloc,goimports,nolintlint // false positive +// CurrentIDs returns the current set mapping ID. func (t *DynamicComm) CurrentIDs() []string { t.lock.Lock() defer t.lock.Unlock() diff --git a/internal/pkg/fleetapi/ack_cmd.go b/internal/pkg/fleetapi/ack_cmd.go index e5fe956753c..525a5d0601d 100644 --- a/internal/pkg/fleetapi/ack_cmd.go +++ b/internal/pkg/fleetapi/ack_cmd.go @@ -41,7 +41,6 @@ type AckEvent struct { // AckRequest consists of multiple actions acked to fleet ui. // POST /agents/{agentId}/acks // Authorization: ApiKey {AgentAccessApiKey} -// // { // "action_ids": ["id1"] // } @@ -62,7 +61,6 @@ type AckResponseItem struct { // AckResponse is the response send back from the server. // 200 -// // { // "action": "acks" // "items": [ diff --git a/internal/pkg/fleetapi/enroll_cmd.go b/internal/pkg/fleetapi/enroll_cmd.go index b5e932fa7e7..0c96ddb531c 100644 --- a/internal/pkg/fleetapi/enroll_cmd.go +++ b/internal/pkg/fleetapi/enroll_cmd.go @@ -78,7 +78,6 @@ func (p EnrollType) MarshalJSON() ([]byte, error) { // // Example: // POST /api/fleet/agents/enroll -// // { // "type": "PERMANENT", // "metadata": { @@ -117,7 +116,6 @@ func (e *EnrollRequest) Validate() error { // EnrollResponse is the data received after enrolling an Agent into fleet. // // Example: -// // { // "action": "created", // "item": { diff --git a/internal/pkg/remote/client.go b/internal/pkg/remote/client.go index b4aa5de5158..ce837a69cf5 100644 --- a/internal/pkg/remote/client.go +++ b/internal/pkg/remote/client.go @@ -248,7 +248,6 @@ func newClient( // - never used // - without errors, last used first when more than one does not have errors // - last errored. -// // It also removes the last error after retryOnBadConnTimeout has elapsed. func (c *Client) sortClients() { now := time.Now().UTC()