61 }
62
63 var min int = int(math.Pow10(size - 1))
64 var max int = int(math.Pow10(size)) - 1 65
66 return f.IntBetween(min, max)
67}
60 return f.RandomDigit()
61 }
62
63 var min int = int(math.Pow10(size - 1)) 64 var max int = int(math.Pow10(size)) - 1
65
66 return f.IntBetween(min, max)
195func (a Address) StreetName() string {
196 street := a.Faker.RandomStringElement(streetNameFormats)
197
198 var p Person = a.Faker.Person()199
200 // {{firstName}}
201 street = strings.Replace(street, "{{firstName}}", p.FirstName(), 1)
177 // {{cityPrefix}}
178 city = strings.Replace(city, "{{cityPrefix}}", a.CityPrefix(), 1)
179
180 var p Person = a.Faker.Person()181
182 // {{firstName}}
183 city = strings.Replace(city, "{{firstName}}", p.FirstName(), 1)
Go infers the types of the variables if the type is not written explicitly. It is recommended to remove the type in the declaration for succinctness.
package main
var foo int = 10
package main
var foo = 10