errors.go 665 B

12345678910111213141516171819202122
  1. package stats
  2. type statsErr struct {
  3. err string
  4. }
  5. func (s statsErr) Error() string {
  6. return s.err
  7. }
  8. // These are the package-wide error values.
  9. // All error identification should use these values.
  10. var (
  11. EmptyInput = statsErr{"Input must not be empty."}
  12. SampleSize = statsErr{"Samples number must be less than input length."}
  13. NaNErr = statsErr{"Not a number"}
  14. NegativeErr = statsErr{"Slice must not contain negative values."}
  15. ZeroErr = statsErr{"Slice must not contain zero values."}
  16. BoundsErr = statsErr{"Input is outside of range."}
  17. SizeErr = statsErr{"Slices must be the same length."}
  18. InfValue = statsErr{"Value is infinite."}
  19. )