// NewRandomUserJson instance the API request
NewRandomUserJson instance the API request
// NewRandomUserJson instance the API request
func NewUsers(results int) (*RandomuserScheme, error) {
	var r RandomuserScheme
	res, err := http.Get(fmt.Sprintf("%s&nat=es&results=%d", endpoint, results))
	defer res.Body.Close()
	if err != nil {
		return nil, err
	}
	if res.StatusCode != http.StatusOK {
		return nil, fmt.Errorf("Error not 200 OK: %s", res.StatusCode)
	}
	err = json.NewDecoder(res.Body).Decode(&r)
	if err != nil {
		return nil, fmt.Errorf("JSON type error: %s", err)
	}
	return &r, nil
}
func NewUsers ( results int ) ( * RandomuserScheme , error ) { var r RandomuserScheme res , err := http . Get ( fmt . Sprintf ( " " , endpoint , results ) ) defer res . Body . Close ( ) if err != nil { return nil , err } if res . StatusCode != http . StatusOK { return nil , fmt . Errorf ( " " , res . StatusCode ) } err = json . NewDecoder ( res . Body ) . Decode ( & r ) if err != nil { return nil , fmt . Errorf ( " " , err ) } return & r , nil }
NewRandomUserJson instance the API request
NewRandomUserJson instance the API request