kmesh-net / kmesh

High Performance ServiceMesh Data Plane Based on Programmable Kernel

Home Page:https://kmesh.net

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Remove using package global variable

hzxuzhonghu opened this issue · comments

In go, it is not recommended to use global variables, unless it is a constant.

Because in go these global vars can be mutated conmcurrently, which may introduce race conditions

FYI https://golangdocs.com/golang-global-variables