mirror of
https://github.com/yanislav-igonin/micrach
synced 2024-12-22 06:12:33 +03:00
17 lines
276 B
Go
17 lines
276 B
Go
package templates
|
|
|
|
// Generates a slice of numbers
|
|
func Iterate(count int) []int {
|
|
var i int
|
|
var Items []int
|
|
for i = 1; i < count+1; i++ {
|
|
Items = append(Items, i)
|
|
}
|
|
return Items
|
|
}
|
|
|
|
// Checks if the value is not nil
|
|
func NotNil(v interface{}) bool {
|
|
return v != nil
|
|
}
|