code: func (wl *BasicNet) UnmarshalJSON(in []byte) error {
  	if in[0] != '"' || in[len(in)-1] != '"' {
  		return errors.New("whitelist: invalid whitelist")
  	}
  
  	if wl.lock == nil {
  		wl.lock = new(sync.Mutex)
  	}
  
  	wl.lock.Lock()
  	defer wl.lock.Unlock()
  
  	var err error
  	netString := strings.TrimSpace(string(in[1 : len(in)-1]))
  	nets := strings.Split(netString, ",")
  	wl.whitelist = make([]*net.IPNet, len(nets))
  	for i := range nets {
  		addr := strings.TrimSpace(nets[i])
  		if addr == "" {
  			continue
  		}
  		_, wl.whitelist[i], err = net.ParseCIDR(addr)
  		if err != nil {
  			wl.whitelist = nil
  			return err
  		}
  	}
  
  	return nil
  }
docs: // UnmarshalJSON implements the json.Unmarshaler interface for network
  // whitelists, taking a comma-separated string of networks.