code: func GetEntityGroupVersion(c context.Context, key *ds.Key) (int64, error) {
  	egm := &EntityGroupMeta{Parent: key.Root()}
  	err := ds.Get(c, egm)
  	ret := egm.Version
  	if err == ds.ErrNoSuchEntity {
  		// this is OK for callers. The version of the entity group is effectively 0
  		// in this case.
  		err = nil
  	}
  	return ret, err
  }
docs: // GetEntityGroupVersion returns the entity group version for the entity group
  // containing root. If the entity group doesn't exist, this function will return
  // zero and a nil error.