Skip to content

Commit 651fd53

Browse files
committed
Make string-removal unconditional, to resolve a linter warning.
1 parent 8c79129 commit 651fd53

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

cmd_serve.go

+2-6
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,7 @@ func alertSubmissionHandler(res http.ResponseWriter, request *http.Request) {
276276
//
277277
// Remove any IPv6-prefix, if present, on the source IP.
278278
//
279-
if strings.HasPrefix(ent.Source, "::ffff:") {
280-
ent.Source = strings.TrimPrefix(ent.Source, "::ffff:")
281-
}
279+
ent.Source = strings.TrimPrefix(ent.Source, "::ffff:")
282280

283281
//
284282
// Add the event.
@@ -323,9 +321,7 @@ func alertSubmissionHandler(res http.ResponseWriter, request *http.Request) {
323321
//
324322
// Remove any IPv6-prefix, if present, on the source IP.
325323
//
326-
if strings.HasPrefix(single.Source, "::ffff:") {
327-
single.Source = strings.TrimPrefix(single.Source, "::ffff:")
328-
}
324+
single.Source = strings.TrimPrefix(single.Source, "::ffff:")
329325

330326
//
331327
// Add it.

0 commit comments

Comments
 (0)