Normal pflag and normal flag package use plain pointers. This is useful if the assumption is that no values will change past initialization of a server.
However, for dynamic flag updating, it causes races. In practice, everything is alright if running on GOMAXPROC=1, but if you go to multiple threads, stuff can break.
An example of running go test -race . in etcd directory:
Normal
pflag
and normalflag
package use plain pointers. This is useful if the assumption is that no values will change past initialization of a server.However, for dynamic flag updating, it causes races. In practice, everything is alright if running on GOMAXPROC=1, but if you go to multiple threads, stuff can break.
An example of running
go test -race .
inetcd
directory: