#How does side-effect imports works in go (lib/pq as example) ?
5 messages · Page 1 of 1 (latest)
5 messages · Page 1 of 1 (latest)
I am confused about how lib/pq functions gets called if we are just marking them as unused imports with _ I read about that and I saw it will call the init() function but that only calls sql.Register which modifies some global variable called drivers but then what ? where is the rest of the package code of lib/pq ?
in the objects it registered
@buoyant field could u elaborate more on this ?