Skip to content

Commit 02a0bb7

Browse files
committed
*: S1034
1 parent 83b267e commit 02a0bb7

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

internal/http_api/api_response.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ func RespondV1(w http.ResponseWriter, code int, data interface{}) {
7272
var isJSON bool
7373

7474
if code == 200 {
75-
switch data.(type) {
75+
switch data := data.(type) {
7676
case string:
77-
response = []byte(data.(string))
77+
response = []byte(data)
7878
case []byte:
79-
response = data.([]byte)
79+
response = data
8080
case nil:
8181
response = []byte{}
8282
default:

nsqd/lookup.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,11 @@ func (n *NSQD) lookupLoop() {
121121
var cmd *nsq.Command
122122
var branch string
123123

124-
switch val.(type) {
124+
switch val := val.(type) {
125125
case *Channel:
126126
// notify all nsqlookupds that a new channel exists, or that it's removed
127127
branch = "channel"
128-
channel := val.(*Channel)
128+
channel := val
129129
if channel.Exiting() {
130130
cmd = nsq.UnRegister(channel.topicName, channel.name)
131131
} else {
@@ -134,7 +134,7 @@ func (n *NSQD) lookupLoop() {
134134
case *Topic:
135135
// notify all nsqlookupds that a new topic exists, or that it's removed
136136
branch = "topic"
137-
topic := val.(*Topic)
137+
topic := val
138138
if topic.Exiting() {
139139
cmd = nsq.UnRegister(topic.name, "")
140140
} else {

0 commit comments

Comments
 (0)