glog.go
func (l *Log) setVState(verbosity Level, modules []modulePat, filepaths []filepathPat, setFilter bool) {
	// Turn verbosity off so V will not fire while we are in transition.
	l.verbosity.set(0)
	// Ditto for filter length.
	atomic.StoreInt32(&l.filterLength, 0)

	// Set the new filters and wipe the pc->Level map if the filter has changed.
	nfilters := 0
	if setFilter {
		if modules != nil {
			l.vmodule.filter = modules
		}
		if filepaths != nil {
			l.vfilepath.filter = filepaths
		}
		nfilters = len(l.vmodule.filter) + len(l.vfilepath.filter)
		l.vmap = make(map[uintptr]Level)
	}

	// Things are consistent now, so enable filtering and verbosity.
	// They are enabled in order opposite to that in V.
	atomic.StoreInt32(&l.filterLength, int32(nfilters))
	l.verbosity.set(verbosity)
}
func (l *Log) setVState(verbosity Level, modules []modulePat, filepaths []filepathPat, setFilter bool) {
	// Turn verbosity off so V will not fire while we are in transition.
	l.verbosity.set(0)
	// Ditto for filter length.
	atomic.StoreInt32(&l.filterLength, 0)

	// Set the new filters and wipe the pc->Level map if the filter has changed.
	nfilters := 0
	if setFilter {
		if modules != nil {
			l.vmodule.filter = modules
		}
		if filepaths != nil {
			l.vfilepath.filter = filepaths
		}
		nfilters = len(l.vmodule.filter) + len(l.vfilepath.filter)
		l.vmap = make(map[uintptr]Level)
	}

	// Things are consistent now, so enable filtering and verbosity.
	// They are enabled in order opposite to that in V.
	atomic.StoreInt32(&l.filterLength, int32(nfilters))
	l.verbosity.set(verbosity)
}
// setVState sets a consistent state for V logging. A nil value for
// modules or filepaths will result in that filter not being changed.
// l.mu is held.