C
Size: a a a
x
func GetNetworkId(ctx *fasthttp.RequestCtx) (int, error) {
host := string(ctx.Host())
idx := strings.Index(host, ".")
if idx == -1 {
return 0, errors.New("prefix not found")
}
val, err := strconv.Atoi(string(host[0:idx]))
return val, err
}
ВС
x
ВС
DS
а
IK
x