code: func cachedHasSynced(hasSynced func() bool) func() bool {
  	cache := &atomic.Value{}
  	cache.Store(false)
  	return func() bool {
  		if cache.Load().(bool) {
  			// short-circuit if already synced
  			return true
  		}
  		if hasSynced() {
  			// remember we synced
  			cache.Store(true)
  			return true
  		}
  		return false
  	}
  }
docs: // cachedHasSynced returns a function that calls hasSynced() until it returns true once, then returns true