integer.go 386 B

12345678910111213
  1. // ⚡️ Fiber is an Express inspired web framework written in Go with ☕️
  2. // 🤖 Github Repository: https://github.com/gofiber/fiber
  3. // 📌 API Documentation: https://docs.gofiber.io
  4. package utils
  5. // DefaultINT returns the provided fallback value if int is 0 or lower
  6. func DefaultINT(value int, defaultValue int) int {
  7. if value <= 0 {
  8. return defaultValue
  9. }
  10. return value
  11. }