code: func (ts *azureTokenSource) Token() (*azureToken, error) {
  	ts.lock.Lock()
  	defer ts.lock.Unlock()
  
  	var err error
  	token := ts.cache.getToken(azureTokenKey)
  	if token == nil {
  		token, err = ts.retrieveTokenFromCfg()
  		if err != nil {
  			token, err = ts.source.Token()
  			if err != nil {
  				return nil, fmt.Errorf("acquiring a new fresh token: %v", err)
  			}
  		}
  		if !token.token.IsExpired() {
  			ts.cache.setToken(azureTokenKey, token)
  			err = ts.storeTokenInCfg(token)
  			if err != nil {
  				return nil, fmt.Errorf("storing the token in configuration: %v", err)
  			}
  		}
  	}
  	if token.token.IsExpired() {
  		token, err = ts.refreshToken(token)
  		if err != nil {
  			return nil, fmt.Errorf("refreshing the expired token: %v", err)
  		}
  		ts.cache.setToken(azureTokenKey, token)
  		err = ts.storeTokenInCfg(token)
  		if err != nil {
  			return nil, fmt.Errorf("storing the refreshed token in configuration: %v", err)
  		}
  	}
  	return token, nil
  }
docs: // Token fetches a token from the cache of configuration if present otherwise
  // acquires a new token from the configured source. Automatically refreshes
  // the token if expired.