aboutsummaryrefslogtreecommitdiffstats
path: root/modules/queue
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2021-04-09 09:40:34 +0200
committerGitHub <noreply@github.com>2021-04-09 09:40:34 +0200
commit9c4601bdf8369ed72944085e3952111cf4aeea11 (patch)
tree2dcadaabed6dbe14ddba2d2513b736ff6b7f089f /modules/queue
parent0991f9aa427ab923544c35d73232fa53c9db9120 (diff)
downloadgitea-9c4601bdf8369ed72944085e3952111cf4aeea11.tar.gz
gitea-9c4601bdf8369ed72944085e3952111cf4aeea11.zip
Code Formats, Nits & Unused Func/Var deletions (#15286)
* _ to unused func options * rm useless brakets * rm trifial non used models functions * rm dead code * rm dead global vars * fix routers/api/v1/repo/issue.go * dont overload import module
Diffstat (limited to 'modules/queue')
-rw-r--r--modules/queue/bytefifo.go4
-rw-r--r--modules/queue/helper.go2
-rw-r--r--modules/queue/queue_bytefifo.go4
-rw-r--r--modules/queue/queue_disk.go2
-rw-r--r--modules/queue/queue_redis.go2
-rw-r--r--modules/queue/unique_queue_disk.go2
-rw-r--r--modules/queue/unique_queue_redis.go2
7 files changed, 9 insertions, 9 deletions
diff --git a/modules/queue/bytefifo.go b/modules/queue/bytefifo.go
index 2cd0ba0b95..94478e6f05 100644
--- a/modules/queue/bytefifo.go
+++ b/modules/queue/bytefifo.go
@@ -23,7 +23,7 @@ type UniqueByteFIFO interface {
Has(data []byte) (bool, error)
}
-var _ (ByteFIFO) = &DummyByteFIFO{}
+var _ ByteFIFO = &DummyByteFIFO{}
// DummyByteFIFO represents a dummy fifo
type DummyByteFIFO struct{}
@@ -48,7 +48,7 @@ func (*DummyByteFIFO) Len() int64 {
return 0
}
-var _ (UniqueByteFIFO) = &DummyUniqueByteFIFO{}
+var _ UniqueByteFIFO = &DummyUniqueByteFIFO{}
// DummyUniqueByteFIFO represents a dummy unique fifo
type DummyUniqueByteFIFO struct {
diff --git a/modules/queue/helper.go b/modules/queue/helper.go
index 161c2fe8e7..e0368bce3a 100644
--- a/modules/queue/helper.go
+++ b/modules/queue/helper.go
@@ -50,7 +50,7 @@ func toConfig(exemplar, cfg interface{}) (interface{}, error) {
var err error
configBytes, err = json.Marshal(cfg)
- ok = (err == nil)
+ ok = err == nil
}
if !ok {
// no ... we've tried hard enough at this point - throw an error!
diff --git a/modules/queue/queue_bytefifo.go b/modules/queue/queue_bytefifo.go
index fe5178ff2d..bc86078493 100644
--- a/modules/queue/queue_bytefifo.go
+++ b/modules/queue/queue_bytefifo.go
@@ -21,7 +21,7 @@ type ByteFIFOQueueConfiguration struct {
Name string
}
-var _ (Queue) = &ByteFIFOQueue{}
+var _ Queue = &ByteFIFOQueue{}
// ByteFIFOQueue is a Queue formed from a ByteFIFO and WorkerPool
type ByteFIFOQueue struct {
@@ -196,7 +196,7 @@ func (q *ByteFIFOQueue) IsTerminated() <-chan struct{} {
return q.terminated
}
-var _ (UniqueQueue) = &ByteFIFOUniqueQueue{}
+var _ UniqueQueue = &ByteFIFOUniqueQueue{}
// ByteFIFOUniqueQueue represents a UniqueQueue formed from a UniqueByteFifo
type ByteFIFOUniqueQueue struct {
diff --git a/modules/queue/queue_disk.go b/modules/queue/queue_disk.go
index 88b8c414c0..6c15a8e63b 100644
--- a/modules/queue/queue_disk.go
+++ b/modules/queue/queue_disk.go
@@ -55,7 +55,7 @@ func NewLevelQueue(handle HandlerFunc, cfg, exemplar interface{}) (Queue, error)
return queue, nil
}
-var _ (ByteFIFO) = &LevelQueueByteFIFO{}
+var _ ByteFIFO = &LevelQueueByteFIFO{}
// LevelQueueByteFIFO represents a ByteFIFO formed from a LevelQueue
type LevelQueueByteFIFO struct {
diff --git a/modules/queue/queue_redis.go b/modules/queue/queue_redis.go
index 2b1d36f0ad..af2cc30335 100644
--- a/modules/queue/queue_redis.go
+++ b/modules/queue/queue_redis.go
@@ -69,7 +69,7 @@ type redisClient interface {
Close() error
}
-var _ (ByteFIFO) = &RedisByteFIFO{}
+var _ ByteFIFO = &RedisByteFIFO{}
// RedisByteFIFO represents a ByteFIFO formed from a redisClient
type RedisByteFIFO struct {
diff --git a/modules/queue/unique_queue_disk.go b/modules/queue/unique_queue_disk.go
index dd6ac1a538..8ec8848bc4 100644
--- a/modules/queue/unique_queue_disk.go
+++ b/modules/queue/unique_queue_disk.go
@@ -59,7 +59,7 @@ func NewLevelUniqueQueue(handle HandlerFunc, cfg, exemplar interface{}) (Queue,
return queue, nil
}
-var _ (UniqueByteFIFO) = &LevelUniqueQueueByteFIFO{}
+var _ UniqueByteFIFO = &LevelUniqueQueueByteFIFO{}
// LevelUniqueQueueByteFIFO represents a ByteFIFO formed from a LevelUniqueQueue
type LevelUniqueQueueByteFIFO struct {
diff --git a/modules/queue/unique_queue_redis.go b/modules/queue/unique_queue_redis.go
index 96fcad1a83..20a50cc1f2 100644
--- a/modules/queue/unique_queue_redis.go
+++ b/modules/queue/unique_queue_redis.go
@@ -62,7 +62,7 @@ func NewRedisUniqueQueue(handle HandlerFunc, cfg, exemplar interface{}) (Queue,
return queue, nil
}
-var _ (UniqueByteFIFO) = &RedisUniqueByteFIFO{}
+var _ UniqueByteFIFO = &RedisUniqueByteFIFO{}
// RedisUniqueByteFIFO represents a UniqueByteFIFO formed from a redisClient
type RedisUniqueByteFIFO struct {