code: func (client *clientImpl) ensureClientVersionInfo(ctx context.Context, fs fs.FileSystem, pin common.Pin, clientExe string) {
  	expect, err := json.Marshal(version.Info{
  		PackageName: pin.PackageName,
  		InstanceID:  pin.InstanceID,
  	})
  	if err != nil {
  		// Should never occur; only error could be if version.Info is not JSON
  		// serializable.
  		logging.WithError(err).Errorf(ctx, "Unable to generate version file content")
  		return
  	}
  
  	verFile := version.GetVersionFile(clientExe)
  	if data, err := ioutil.ReadFile(verFile); err == nil && bytes.Equal(expect, data) {
  		return // up to date
  	}
  
  	// There was an error reading the existing version file, or its content does
  	// not match. Proceed with EnsureFile.
  	err = fs.EnsureFile(ctx, verFile, func(of *os.File) error {
  		_, err := of.Write(expect)
  		return err
  	})
  	if err != nil {
  		logging.WithError(err).Warningf(ctx, "Unable to update version info %q", verFile)
  	}
  }
docs: // ensureClientVersionInfo is called only with the specially constructed client,
  // see MaybeUpdateClient function.