forked from ebhomengo/niki
1
0
Fork 0
niki/vendor/github.com/brianvoe/gofakeit/v6/school.go

29 lines
783 B
Go
Raw Normal View History

2024-04-26 19:30:35 +00:00
package gofakeit
import "math/rand"
// School will generate a random School type
func School() string { return school(globalFaker.Rand) }
func (f *Faker) School() string { return school(f.Rand) }
func school(r *rand.Rand) string {
return getRandValue(
r, []string{"school", "name"}) + " " +
getRandValue(r, []string{"school", "isPrivate"}) + " " +
getRandValue(r, []string{"school", "type"})
}
func addSchoolLookup() {
AddFuncLookup("school", Info{
Display: "School",
Category: "school",
Description: "An institution for formal education and learning",
Example: `Harborview State Academy`,
Output: "string",
Generate: func(r *rand.Rand, m *MapParams, info *Info) (any, error) {
return school(r), nil
},
})
}