From 4df1dc5d98bc32436f6c3ac67dfef57041c93a64 Mon Sep 17 00:00:00 2001 From: Tobias Gesellchen Date: Fri, 27 Dec 2024 15:32:30 +0100 Subject: [PATCH] Apply go fmt --- couchdb-exporter_test.go | 2 +- lib/couchdb-client.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/couchdb-exporter_test.go b/couchdb-exporter_test.go index a614436..2a950b8 100644 --- a/couchdb-exporter_test.go +++ b/couchdb-exporter_test.go @@ -281,7 +281,7 @@ func TestCouchdbStatsV1Integration(t *testing.T) { } } -func awaitMembership(t *testing.T,localOnly bool, basicAuth lib.BasicAuth) func(address string) (bool, error) { +func awaitMembership(t *testing.T, localOnly bool, basicAuth lib.BasicAuth) func(address string) (bool, error) { time.Sleep(5 * time.Second) return func(address string) (bool, error) { diff --git a/lib/couchdb-client.go b/lib/couchdb-client.go index 94be5b8..70e45ae 100644 --- a/lib/couchdb-client.go +++ b/lib/couchdb-client.go @@ -42,7 +42,7 @@ func (httpError *HttpError) Error() string { type MembershipResponse struct { AllNodes []string `json:"all_nodes"` ClusterNodes []string `json:"cluster_nodes"` - SingleNode string `json:"name"` + SingleNode string `json:"name"` } func (c *CouchdbClient) getNodeInfo(uri string) (NodeInfo, error) { @@ -84,7 +84,7 @@ func (c *CouchdbClient) isCouchDbV1() (bool, error) { func (c *CouchdbClient) GetNodeNames(localOnly bool) ([]string, error) { var nodeDiscovery string = "_membership" if localOnly { - nodeDiscovery="_node/_local" + nodeDiscovery = "_node/_local" } data, err := c.Request("GET", fmt.Sprintf("%s/%s", c.BaseUri, nodeDiscovery), nil) if err != nil { @@ -96,7 +96,7 @@ func (c *CouchdbClient) GetNodeNames(localOnly bool) ([]string, error) { return nil, err } if localOnly { - membership.ClusterNodes=append(membership.ClusterNodes,membership.SingleNode) + membership.ClusterNodes = append(membership.ClusterNodes, membership.SingleNode) } // for i, name := range membership.ClusterNodes { // slog.Infof("node[%d]: %s\n", i, name)