File tree Expand file tree Collapse file tree 4 files changed +42
-3
lines changed
Expand file tree Collapse file tree 4 files changed +42
-3
lines changed Original file line number Diff line number Diff line change 1- package utils
1+ package date_utils
22
33import "time"
44
Original file line number Diff line number Diff line change 1- package utils
1+ package file_utils
22
33import (
44 "os"
Original file line number Diff line number Diff line change 1+ package int_utils
2+
3+ // Min returns the smallest integer from a list of integers.
4+ func Min (nums ... int ) int {
5+ if len (nums ) == 0 {
6+ return 0 // or some error value
7+ }
8+ min := nums [0 ]
9+ for _ , num := range nums {
10+ if num < min {
11+ min = num
12+ }
13+ }
14+ return min
15+ }
16+
17+ // Max returns the largest integer from a list of integers.
18+ func Max (nums ... int ) int {
19+ if len (nums ) == 0 {
20+ return 0 // or some error value
21+ }
22+ max := nums [0 ]
23+ for _ , num := range nums {
24+ if num > max {
25+ max = num
26+ }
27+ }
28+ return max
29+ }
30+
31+ // IsEven returns true if the integer is even.
32+ func IsEven (n int ) bool {
33+ return n % 2 == 0
34+ }
35+
36+ // IsOdd returns true if the integer is odd.
37+ func IsOdd (n int ) bool {
38+ return n % 2 != 0
39+ }
Original file line number Diff line number Diff line change 1- package utils
1+ package strings_utils
22
33import (
44 "regexp"
You can’t perform that action at this time.
0 commit comments