func Number(numberRange ...int) int {
	nr := 0
	if len(numberRange) > 1 {
		nr = 1
		nr = privateRand.Intn(numberRange[1]-numberRange[0]) + numberRange[0]
	} else {
		nr = privateRand.Intn(numberRange[0])
	}
	return nr
}
Number returns a random number, if only one integer (n1) is supplied it returns a number in [0,n1)
if a second argument is supplied it returns a number in [n1,n2)
package randomdata
import (
	"encoding/json"
	"fmt"
	"log"
	"math/rand"
	"net"
	"strconv"
	"strings"
	"sync"
	"time"
	"unicode"
)
const (
	Male         int = 0
	Female       int = 1
	RandomGender int = 2
)
const (
	Small int = 0
	Large int = 1
)
const (
	FullCountry      = 0
	TwoCharCountry   = 1
	ThreeCharCountry = 2
)
const (
	DateInputLayout  = "2006-01-02"
	DateOutputLayout = "Monday 2 Jan 2006"
)
const ALPHANUMERIC = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
type jsonContent struct {
	Adjectives          []string `json:"adjectives"`
	Nouns               []string `json:"nouns"`
	FirstNamesFemale    []string `json:"firstNamesFemale"`
	FirstNamesMale      []string `json:"firstNamesMale"`
	LastNames           []string `json:"lastNames"`
	Domains             []string `json:"domains"`
	People              []string `json:"people"`
	StreetTypes         []string `json:"streetTypes"`  
	Paragraphs          []string `json:"paragraphs"`   
	Countries           []string `json:"countries"`    
	CountriesThreeChars []string `json:"countriesThreeChars"`
	CountriesTwoChars   []string `json:"countriesTwoChars"`
	Currencies          []string `json:"currencies"`  
	Cities              []string `json:"cities"`
	States              []string `json:"states"`
	StatesSmall         []string `json:"statesSmall"`
	Days                []string `json:"days"`
	Months              []string `json:"months"`
	FemaleTitles        []string `json:"femaleTitles"`
	MaleTitles          []string `json:"maleTitles"`
	Timezones           []string `json:"timezones"`            
	Locales             []string `json:"locales"`              
	UserAgents          []string `json:"userAgents"`           
	CountryCallingCodes []string `json:"countryCallingCodes"`  
	ProvincesGB         []string `json:"provincesGB"`
	StreetNameGB        []string `json:"streetNameGB"`
	StreetTypesGB       []string `json:"streetTypesGB"`
}
type pRand struct {
	pr *rand.Rand
	mu *sync.Mutex
}
func (r *pRand) Intn(n int) int {
	r.mu.Lock()
	defer r.mu.Unlock()
	return r.pr.Intn(n)
}
func (r *pRand) Float64() float64 {
	r.mu.Lock()
	defer r.mu.Unlock()
	return r.pr.Float64()
}
var jsonData = jsonContent{}
var privateRand *pRand
func init() {
	privateRand = &pRand{rand.New(rand.NewSource(time.Now().UnixNano())), &sync.Mutex{}}
	jsonData = jsonContent{}
	err := json.Unmarshal(data, &jsonData)
	if err != nil {
		log.Fatal(err)
	}
}
func CustomRand(randToUse *rand.Rand) {
	privateRand.pr = randToUse
}
func randomFrom(source []string) string {
	return source[privateRand.Intn(len(source))]
}
func Title(gender int) string {
	switch gender {
	case Male:
		return randomFrom(jsonData.MaleTitles)
	case Female:
		return randomFrom(jsonData.FemaleTitles)
	default:
		return Title(privateRand.Intn(2))
	}
}
func FirstName(gender int) string {
	var name = ""
	switch gender {
	case Male:
		name = randomFrom(jsonData.FirstNamesMale)
		break
	case Female:
		name = randomFrom(jsonData.FirstNamesFemale)
		break
	default:
		name = FirstName(rand.Intn(2))
		break
	}
	return name
}
func LastName() string {
	return randomFrom(jsonData.LastNames)
}
func FullName(gender int) string {
	return FirstName(gender) + " " + LastName()
}
func Email() string {
	return strings.ToLower(FirstName(RandomGender)+LastName()) + StringNumberExt(1, "", 3) + "@" + randomFrom(jsonData.Domains)
}
func Country(countryStyle int64) string {
	country := ""
	switch countryStyle {
	default:
	case FullCountry:
		country = randomFrom(jsonData.Countries)
		break
	case TwoCharCountry:
		country = randomFrom(jsonData.CountriesTwoChars)
		break
	case ThreeCharCountry:
		country = randomFrom(jsonData.CountriesThreeChars)
		break
	}
	return country
}
func Currency() string {
	return randomFrom(jsonData.Currencies)
}
func City() string {
	return randomFrom(jsonData.Cities)
}
func ProvinceForCountry(countrycode string) string {
	switch countrycode {
	case "US":
		return randomFrom(jsonData.States)
	case "GB":
		return randomFrom(jsonData.ProvincesGB)
	}
	return ""
}
func State(typeOfState int) string {
	if typeOfState == Small {
		return randomFrom(jsonData.StatesSmall)
	}
	return randomFrom(jsonData.States)
}
func Street() string {
	return fmt.Sprintf("%s %s", randomFrom(jsonData.People), randomFrom(jsonData.StreetTypes))
}
func StreetForCountry(countrycode string) string {
	switch countrycode {
	case "US":
		return Street()
	case "GB":
		return fmt.Sprintf("%s %s", randomFrom(jsonData.StreetNameGB), randomFrom(jsonData.StreetTypesGB))
	}
	return ""
}
func Address() string {
	return fmt.Sprintf("%d %s,\n%s, %s, %s", Number(100), Street(), City(), State(Small), PostalCode("US"))
}
func Paragraph() string {
	return randomFrom(jsonData.Paragraphs)
}