-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
We have a few global variables, e.g.:
message.DefaultMessageCodecs
client.HandshakeHandler
- and all the datatypes and data codecs in
datatype
package.
Global variables are not guaranteed to be immutable, and even if they are (because the type is an interface with only accessor methods), one could still set the variable to nil.
For example you cannot forbid a user from doing:
message.DefaultMessageCodecs = nil
datatype.Int = datatype.Varchar
... which would screw up the library.
The Go community itself seems to hesitate about using global variables. Several packages have global variables, e.g. time.UTC
.
We need to asses if it's safe to keep the global variables around or if we should remove them.
Relevant articles on this topic:
Metadata
Metadata
Assignees
Labels
No labels