code: func SetPackageHidden(c context.Context, pkg string, hidden bool) error {
  	return Txn(c, "SetPackageHidden", func(c context.Context) error {
  		p := &Package{Name: pkg}
  		switch err := datastore.Get(c, p); {
  		case err == datastore.ErrNoSuchEntity:
  			return err
  		case err != nil:
  			return transient.Tag.Apply(err)
  		case p.Hidden == hidden:
  			return nil
  		}
  
  		p.Hidden = hidden
  		if err := datastore.Put(c, p); err != nil {
  			return transient.Tag.Apply(err)
  		}
  
  		ev := api.EventKind_PACKAGE_HIDDEN
  		if !hidden {
  			ev = api.EventKind_PACKAGE_UNHIDDEN
  		}
  		return EmitEvent(c, &api.Event{Kind: ev, Package: pkg})
  	})
  }
docs: // SetPackageHidden updates Hidden field of the package.
  //
  // If the package is missing returns datastore.ErrNoSuchEntity. All other errors
  // are transient.