code: func (s PinSlice) Validate(v HashAlgoValidation) error {
  	dedup := stringset.New(len(s))
  	for _, p := range s {
  		if err := ValidatePin(p, v); err != nil {
  			return err
  		}
  		if !dedup.Add(p.PackageName) {
  			return fmt.Errorf("duplicate package %q", p.PackageName)
  		}
  	}
  	return nil
  }
docs: // Validate ensures that this PinSlice contains no duplicate packages or invalid
  // pins.