Skip to content

Commit

Permalink
Merge pull request #27 from Fenny/master
Browse files Browse the repository at this point in the history
Create integer.go
  • Loading branch information
Fenny authored Nov 5, 2020
2 parents 30753dd + 71f751f commit 98ba4e6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions integer.go
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit 98ba4e6

Please sign in to comment.