Skip to content

Commit 22c1933

Browse files
Merge pull request #12 from fabricekabongo/deepsource-autofix-c6511b48
refactor: fix unused method receiver
2 parents f7cd204 + 70da7fb commit 22c1933

5 files changed

Lines changed: 24 additions & 19 deletions

File tree

admin/ops.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@ package admin
33
import (
44
"embed"
55
"encoding/json"
6-
"github.com/fabricekabongo/loggerhead/clustering"
7-
"github.com/fabricekabongo/loggerhead/config"
8-
"github.com/prometheus/client_golang/prometheus/promhttp"
96
"html/template"
107
"log"
118
"net/http"
129
"runtime"
10+
11+
"github.com/fabricekabongo/loggerhead/clustering"
12+
"github.com/fabricekabongo/loggerhead/config"
13+
"github.com/prometheus/client_golang/prometheus/promhttp"
1314
)
1415

1516
var (
@@ -128,7 +129,7 @@ func (o *OpsServer) AdminData() http.Handler {
128129
})
129130
}
130131

131-
func (o *OpsServer) AdminUI() http.Handler {
132+
func (*OpsServer) AdminUI() http.Handler {
132133
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
133134
err := TMPL.Execute(w, nil)
134135
if err != nil {

clustering/broadcast-delegate.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
package clustering
22

33
import (
4+
"log"
5+
"os"
6+
47
"github.com/fabricekabongo/loggerhead/query"
58
"github.com/fabricekabongo/loggerhead/world"
69
"github.com/hashicorp/memberlist"
710
"github.com/prometheus/client_golang/prometheus"
811
"github.com/prometheus/client_golang/prometheus/promauto"
9-
"log"
10-
"os"
1112
)
1213

1314
var (
@@ -52,7 +53,7 @@ func newBroadcastDelegate(engine *query.Engine, broadcasts *memberlist.TransmitL
5253
}
5354
}
5455

55-
func (d *BroadcastDelegate) NodeMeta(limit int) []byte {
56+
func (*BroadcastDelegate) NodeMeta(limit int) []byte {
5657
return []byte{}
5758
}
5859

query/query.go

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@ package query
22

33
import (
44
"errors"
5-
w "github.com/fabricekabongo/loggerhead/world"
6-
"github.com/prometheus/client_golang/prometheus"
7-
"github.com/prometheus/client_golang/prometheus/promauto"
85
"log"
96
"os"
107
"strconv"
118
"strings"
129
"time"
10+
11+
w "github.com/fabricekabongo/loggerhead/world"
12+
"github.com/prometheus/client_golang/prometheus"
13+
"github.com/prometheus/client_golang/prometheus/promauto"
1314
)
1415

1516
var (
@@ -205,7 +206,7 @@ func (p *GetQueryProcessor) Execute(query string) string {
205206
return stringBuilder.String()
206207
}
207208

208-
func (p *GetQueryProcessor) CanProcess(query string) bool {
209+
func (*GetQueryProcessor) CanProcess(query string) bool {
209210
chunks := strings.Split(query, " ")
210211
if len(chunks) != 3 {
211212
return false
@@ -248,7 +249,7 @@ func (p *DeleteQueryProcessor) Execute(query string) string {
248249
return version + ",deleted\n"
249250
}
250251

251-
func (p *DeleteQueryProcessor) CanProcess(query string) bool {
252+
func (*DeleteQueryProcessor) CanProcess(query string) bool {
252253
chunks := strings.Split(query, " ")
253254
if len(chunks) != 3 {
254255
return false
@@ -305,7 +306,7 @@ func (p *SaveQueryProcessor) Execute(query string) string {
305306
return version + ",saved\n"
306307
}
307308

308-
func (p *SaveQueryProcessor) CanProcess(query string) bool {
309+
func (*SaveQueryProcessor) CanProcess(query string) bool {
309310
chunks := strings.Split(query, " ")
310311
if len(chunks) != 5 {
311312
return false
@@ -370,7 +371,7 @@ func (p *PolyQueryProcessor) Execute(query string) string {
370371
return result.String()
371372
}
372373

373-
func (p *PolyQueryProcessor) CanProcess(query string) bool {
374+
func (*PolyQueryProcessor) CanProcess(query string) bool {
374375
chunks := strings.Split(query, " ")
375376
if len(chunks) != 6 {
376377
return false

world/location.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ import (
44
"encoding/gob"
55
"errors"
66
"fmt"
7+
"time"
8+
79
"github.com/prometheus/client_golang/prometheus"
810
"github.com/prometheus/client_golang/prometheus/promauto"
9-
"time"
1011
)
1112

1213
var (
@@ -58,7 +59,7 @@ func NewLocation(ns string, id string, lat float64, lon float64) (*Location, err
5859
return loc, nil
5960
}
6061

61-
func (l *Location) init(ns string, id string, lat float64, lon float64) (*Location, error) {
62+
func (*Location) init(ns string, id string, lat float64, lon float64) (*Location, error) {
6263
if len(id) == 0 {
6364
validationOps.Inc()
6465
return nil, LocationErrorRequiredId

world/tree.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ package world
22

33
import (
44
"errors"
5-
"github.com/prometheus/client_golang/prometheus"
6-
"github.com/prometheus/client_golang/prometheus/promauto"
75
"math"
86
"sync"
7+
8+
"github.com/prometheus/client_golang/prometheus"
9+
"github.com/prometheus/client_golang/prometheus/promauto"
910
)
1011

1112
var (
@@ -155,7 +156,7 @@ func (node *TreeNode) divide() {
155156
node.mu.Unlock()
156157
}
157158

158-
func (q *QuadTree) reBalance() {
159+
func (*QuadTree) reBalance() {
159160
// TODO: Implement rebalancing
160161
}
161162

0 commit comments

Comments
 (0)