srv.RespondOK   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 4
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
dl 0
loc 4
c 0
b 0
f 0
rs 10
nop 3
1
package srv
2
3
import (
4
	"encoding/json"
5
	"net/http"
6
)
7
8
func RespondOK(data any, w http.ResponseWriter, _ *http.Request) {
9
	w.Header().Set("Content-Type", "application/json; charset=utf-8")
10
	w.WriteHeader(http.StatusOK)
11
	_ = json.NewEncoder(w).Encode(data)
12
}
13