internal/common/srv/http_ok.go   A
last analyzed

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 8
dl 0
loc 11
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A srv.RespondOK 0 4 1
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