diff --git a/integer.go b/integer.go new file mode 100644 index 0000000..c01923d --- /dev/null +++ b/integer.go @@ -0,0 +1,13 @@ +// ⚡️ Fiber is an Express inspired web framework written in Go with ☕️ +// 🤖 Github Repository: https://github.com/gofiber/fiber +// 📌 API Documentation: https://docs.gofiber.io + +package utils + +// DefaultINT returns the provided fallback value if int is 0 or lower +func DefaultINT(value int, defaultValue int) int { + if value <= 0 { + return defaultValue + } + return value +}