diff --git a/endpoint/age_rating_categories.go b/endpoint/age_rating_categories.go index d333539..cceda24 100644 --- a/endpoint/age_rating_categories.go +++ b/endpoint/age_rating_categories.go @@ -35,9 +35,5 @@ func (a *AgeRatingCategories) Query(ctx context.Context, query string) ([]*pb.Ag return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Ageratingcategories) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Ageratingcategories, nil } diff --git a/endpoint/age_rating_content_descriptions.go b/endpoint/age_rating_content_descriptions.go index bbfc2de..8ec9ca0 100644 --- a/endpoint/age_rating_content_descriptions.go +++ b/endpoint/age_rating_content_descriptions.go @@ -35,9 +35,5 @@ func (a *AgeRatingContentDescriptions) Query(ctx context.Context, query string) return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Ageratingcontentdescriptions) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Ageratingcontentdescriptions, nil } diff --git a/endpoint/age_rating_content_descriptions_v2.go b/endpoint/age_rating_content_descriptions_v2.go index cd878dc..4d903be 100644 --- a/endpoint/age_rating_content_descriptions_v2.go +++ b/endpoint/age_rating_content_descriptions_v2.go @@ -35,9 +35,5 @@ func (a *AgeRatingContentDescriptionsV2) Query(ctx context.Context, query string return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Ageratingcontentdescriptionsv2) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Ageratingcontentdescriptionsv2, nil } diff --git a/endpoint/age_rating_organizations.go b/endpoint/age_rating_organizations.go index 0fda8c9..a5edc29 100644 --- a/endpoint/age_rating_organizations.go +++ b/endpoint/age_rating_organizations.go @@ -35,9 +35,5 @@ func (a *AgeRatingOrganizations) Query(ctx context.Context, query string) ([]*pb return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Ageratingorganizations) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Ageratingorganizations, nil } diff --git a/endpoint/age_ratings.go b/endpoint/age_ratings.go index 3e13528..146b5ce 100644 --- a/endpoint/age_ratings.go +++ b/endpoint/age_ratings.go @@ -35,9 +35,5 @@ func (a *AgeRatings) Query(ctx context.Context, query string) ([]*pb.AgeRating, return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Ageratings) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Ageratings, nil } diff --git a/endpoint/alternative_names.go b/endpoint/alternative_names.go index b546eb1..e910217 100644 --- a/endpoint/alternative_names.go +++ b/endpoint/alternative_names.go @@ -35,9 +35,5 @@ func (a *AlternativeNames) Query(ctx context.Context, query string) ([]*pb.Alter return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Alternativenames) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Alternativenames, nil } diff --git a/endpoint/artworks.go b/endpoint/artworks.go index 3913910..4f82ab6 100644 --- a/endpoint/artworks.go +++ b/endpoint/artworks.go @@ -35,9 +35,5 @@ func (a *Artworks) Query(ctx context.Context, query string) ([]*pb.Artwork, erro return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Artworks) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Artworks, nil } diff --git a/endpoint/character_genders.go b/endpoint/character_genders.go index c885b1c..3d0dce8 100644 --- a/endpoint/character_genders.go +++ b/endpoint/character_genders.go @@ -35,9 +35,5 @@ func (a *CharacterGenders) Query(ctx context.Context, query string) ([]*pb.Chara return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Charactergenders) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Charactergenders, nil } diff --git a/endpoint/character_mug_shots.go b/endpoint/character_mug_shots.go index fb42385..f60da9b 100644 --- a/endpoint/character_mug_shots.go +++ b/endpoint/character_mug_shots.go @@ -35,9 +35,5 @@ func (a *CharacterMugShots) Query(ctx context.Context, query string) ([]*pb.Char return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Charactermugshots) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Charactermugshots, nil } diff --git a/endpoint/character_species.go b/endpoint/character_species.go index 3dc10c3..c664125 100644 --- a/endpoint/character_species.go +++ b/endpoint/character_species.go @@ -35,9 +35,5 @@ func (a *CharacterSpecies) Query(ctx context.Context, query string) ([]*pb.Chara return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Characterspecies) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Characterspecies, nil } diff --git a/endpoint/characters.go b/endpoint/characters.go index 9aa70e8..11cb7ed 100644 --- a/endpoint/characters.go +++ b/endpoint/characters.go @@ -35,9 +35,5 @@ func (a *Characters) Query(ctx context.Context, query string) ([]*pb.Character, return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Characters) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Characters, nil } diff --git a/endpoint/collection_membership_types.go b/endpoint/collection_membership_types.go index 4b37f3a..c85d9a0 100644 --- a/endpoint/collection_membership_types.go +++ b/endpoint/collection_membership_types.go @@ -35,9 +35,5 @@ func (a *CollectionMembershipTypes) Query(ctx context.Context, query string) ([] return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Collectionmembershiptypes) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Collectionmembershiptypes, nil } diff --git a/endpoint/collection_memberships.go b/endpoint/collection_memberships.go index 6b8c7f9..cb9bba6 100644 --- a/endpoint/collection_memberships.go +++ b/endpoint/collection_memberships.go @@ -35,9 +35,5 @@ func (a *CollectionMemberships) Query(ctx context.Context, query string) ([]*pb. return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Collectionmemberships) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Collectionmemberships, nil } diff --git a/endpoint/collection_relation_types.go b/endpoint/collection_relation_types.go index cf08e0b..78026a9 100644 --- a/endpoint/collection_relation_types.go +++ b/endpoint/collection_relation_types.go @@ -35,9 +35,5 @@ func (a *CollectionRelationTypes) Query(ctx context.Context, query string) ([]*p return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Collectionrelationtypes) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Collectionrelationtypes, nil } diff --git a/endpoint/collection_relations.go b/endpoint/collection_relations.go index b475891..90144a5 100644 --- a/endpoint/collection_relations.go +++ b/endpoint/collection_relations.go @@ -35,9 +35,5 @@ func (a *CollectionRelations) Query(ctx context.Context, query string) ([]*pb.Co return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Collectionrelations) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Collectionrelations, nil } diff --git a/endpoint/collection_types.go b/endpoint/collection_types.go index 1665cef..cb6b1fd 100644 --- a/endpoint/collection_types.go +++ b/endpoint/collection_types.go @@ -35,9 +35,5 @@ func (a *CollectionTypes) Query(ctx context.Context, query string) ([]*pb.Collec return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Collectiontypes) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Collectiontypes, nil } diff --git a/endpoint/collections.go b/endpoint/collections.go index dd2d3a2..535db77 100644 --- a/endpoint/collections.go +++ b/endpoint/collections.go @@ -35,9 +35,5 @@ func (a *Collections) Query(ctx context.Context, query string) ([]*pb.Collection return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Collections) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Collections, nil } diff --git a/endpoint/companies.go b/endpoint/companies.go index d4847b5..9aadb4c 100644 --- a/endpoint/companies.go +++ b/endpoint/companies.go @@ -2,7 +2,6 @@ package endpoint import ( "context" - "errors" "fmt" pb "github.com/bestnite/go-igdb/proto" @@ -36,9 +35,5 @@ func (a *Companies) Query(ctx context.Context, query string) ([]*pb.Company, err return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Companies) == 0 { - return nil, errors.New("no results") - } - return data.Companies, nil } diff --git a/endpoint/company_logos.go b/endpoint/company_logos.go index 548862c..9ae36c3 100644 --- a/endpoint/company_logos.go +++ b/endpoint/company_logos.go @@ -35,9 +35,5 @@ func (a *CompanyLogos) Query(ctx context.Context, query string) ([]*pb.CompanyLo return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Companylogos) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Companylogos, nil } diff --git a/endpoint/company_statuses.go b/endpoint/company_statuses.go index 0b56f7d..aa47436 100644 --- a/endpoint/company_statuses.go +++ b/endpoint/company_statuses.go @@ -35,9 +35,5 @@ func (a *CompanyStatuses) Query(ctx context.Context, query string) ([]*pb.Compan return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Companystatuses) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Companystatuses, nil } diff --git a/endpoint/company_websites.go b/endpoint/company_websites.go index 2b9ef40..1c9cd3c 100644 --- a/endpoint/company_websites.go +++ b/endpoint/company_websites.go @@ -35,9 +35,5 @@ func (a *CompanyWebsites) Query(ctx context.Context, query string) ([]*pb.Compan return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Companywebsites) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Companywebsites, nil } diff --git a/endpoint/covers.go b/endpoint/covers.go index e6a4392..3e4c60c 100644 --- a/endpoint/covers.go +++ b/endpoint/covers.go @@ -35,9 +35,5 @@ func (a *Covers) Query(ctx context.Context, query string) ([]*pb.Cover, error) { return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Covers) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Covers, nil } diff --git a/endpoint/date_formats.go b/endpoint/date_formats.go index 0b7df21..a852449 100644 --- a/endpoint/date_formats.go +++ b/endpoint/date_formats.go @@ -35,9 +35,5 @@ func (a *DateFormats) Query(ctx context.Context, query string) ([]*pb.DateFormat return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Dateformats) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Dateformats, nil } diff --git a/endpoint/event_logos.go b/endpoint/event_logos.go index f2aca90..372bc63 100644 --- a/endpoint/event_logos.go +++ b/endpoint/event_logos.go @@ -35,9 +35,5 @@ func (a *EventLogos) Query(ctx context.Context, query string) ([]*pb.EventLogo, return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Eventlogos) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Eventlogos, nil } diff --git a/endpoint/event_networks.go b/endpoint/event_networks.go index 2af5aa4..d3ec3fe 100644 --- a/endpoint/event_networks.go +++ b/endpoint/event_networks.go @@ -35,9 +35,5 @@ func (a *EventNetworks) Query(ctx context.Context, query string) ([]*pb.EventNet return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Eventnetworks) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Eventnetworks, nil } diff --git a/endpoint/events.go b/endpoint/events.go index 64902d1..dc44445 100644 --- a/endpoint/events.go +++ b/endpoint/events.go @@ -35,9 +35,5 @@ func (a *Events) Query(ctx context.Context, query string) ([]*pb.Event, error) { return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Events) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Events, nil } diff --git a/endpoint/external_game_sources.go b/endpoint/external_game_sources.go index 5c3fbbe..a4202df 100644 --- a/endpoint/external_game_sources.go +++ b/endpoint/external_game_sources.go @@ -35,9 +35,5 @@ func (a *ExternalGameSources) Query(ctx context.Context, query string) ([]*pb.Ex return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Externalgamesources) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Externalgamesources, nil } diff --git a/endpoint/external_games.go b/endpoint/external_games.go index 3e6f6c6..0d15b19 100644 --- a/endpoint/external_games.go +++ b/endpoint/external_games.go @@ -35,9 +35,5 @@ func (a *ExternalGames) Query(ctx context.Context, query string) ([]*pb.External return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Externalgames) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Externalgames, nil } diff --git a/endpoint/franchises.go b/endpoint/franchises.go index ac2ab38..4bbfb4e 100644 --- a/endpoint/franchises.go +++ b/endpoint/franchises.go @@ -35,9 +35,5 @@ func (a *Franchises) Query(ctx context.Context, query string) ([]*pb.Franchise, return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Franchises) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Franchises, nil } diff --git a/endpoint/game_engine_logos.go b/endpoint/game_engine_logos.go index a9a3747..21ad010 100644 --- a/endpoint/game_engine_logos.go +++ b/endpoint/game_engine_logos.go @@ -35,9 +35,5 @@ func (a *GameEngineLogos) Query(ctx context.Context, query string) ([]*pb.GameEn return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Gameenginelogos) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Gameenginelogos, nil } diff --git a/endpoint/game_engines.go b/endpoint/game_engines.go index 74e1e04..7b4b5c5 100644 --- a/endpoint/game_engines.go +++ b/endpoint/game_engines.go @@ -35,9 +35,5 @@ func (a *GameEngines) Query(ctx context.Context, query string) ([]*pb.GameEngine return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Gameengines) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Gameengines, nil } diff --git a/endpoint/game_localizations.go b/endpoint/game_localizations.go index b5496a3..2efd944 100644 --- a/endpoint/game_localizations.go +++ b/endpoint/game_localizations.go @@ -35,9 +35,5 @@ func (a *GameLocalizations) Query(ctx context.Context, query string) ([]*pb.Game return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Gamelocalizations) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Gamelocalizations, nil } diff --git a/endpoint/game_modes.go b/endpoint/game_modes.go index ea5ff4f..1a50b1d 100644 --- a/endpoint/game_modes.go +++ b/endpoint/game_modes.go @@ -35,9 +35,5 @@ func (a *GameModes) Query(ctx context.Context, query string) ([]*pb.GameMode, er return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Gamemodes) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Gamemodes, nil } diff --git a/endpoint/game_release_formats.go b/endpoint/game_release_formats.go index f24e648..2ad2afd 100644 --- a/endpoint/game_release_formats.go +++ b/endpoint/game_release_formats.go @@ -35,9 +35,5 @@ func (a *GameReleaseFormats) Query(ctx context.Context, query string) ([]*pb.Gam return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Gamereleaseformats) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Gamereleaseformats, nil } diff --git a/endpoint/game_statuses.go b/endpoint/game_statuses.go index 7744a16..fc8104c 100644 --- a/endpoint/game_statuses.go +++ b/endpoint/game_statuses.go @@ -35,9 +35,5 @@ func (a *GameStatuses) Query(ctx context.Context, query string) ([]*pb.GameStatu return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Gamestatuses) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Gamestatuses, nil } diff --git a/endpoint/game_time_to_beats.go b/endpoint/game_time_to_beats.go index b2d0ded..fa9dffb 100644 --- a/endpoint/game_time_to_beats.go +++ b/endpoint/game_time_to_beats.go @@ -35,9 +35,5 @@ func (a *GameTimeToBeats) Query(ctx context.Context, query string) ([]*pb.GameTi return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Gametimetobeats) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Gametimetobeats, nil } diff --git a/endpoint/game_types.go b/endpoint/game_types.go index e2f5c7f..be5fd1e 100644 --- a/endpoint/game_types.go +++ b/endpoint/game_types.go @@ -35,9 +35,5 @@ func (a *GameTypes) Query(ctx context.Context, query string) ([]*pb.GameType, er return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Gametypes) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Gametypes, nil } diff --git a/endpoint/game_version_feature_values.go b/endpoint/game_version_feature_values.go index 70ef38b..9cfb1e0 100644 --- a/endpoint/game_version_feature_values.go +++ b/endpoint/game_version_feature_values.go @@ -35,9 +35,5 @@ func (a *GameVersionFeatureValues) Query(ctx context.Context, query string) ([]* return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Gameversionfeaturevalues) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Gameversionfeaturevalues, nil } diff --git a/endpoint/game_version_features.go b/endpoint/game_version_features.go index f5d2158..90887a0 100644 --- a/endpoint/game_version_features.go +++ b/endpoint/game_version_features.go @@ -35,9 +35,5 @@ func (a *GameVersionFeatures) Query(ctx context.Context, query string) ([]*pb.Ga return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Gameversionfeatures) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Gameversionfeatures, nil } diff --git a/endpoint/game_versions.go b/endpoint/game_versions.go index 104255d..f50140d 100644 --- a/endpoint/game_versions.go +++ b/endpoint/game_versions.go @@ -35,9 +35,5 @@ func (a *GameVersions) Query(ctx context.Context, query string) ([]*pb.GameVersi return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Gameversions) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Gameversions, nil } diff --git a/endpoint/game_videos.go b/endpoint/game_videos.go index fdfc4f9..f421616 100644 --- a/endpoint/game_videos.go +++ b/endpoint/game_videos.go @@ -35,9 +35,5 @@ func (a *GameVideos) Query(ctx context.Context, query string) ([]*pb.GameVideo, return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Gamevideos) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Gamevideos, nil } diff --git a/endpoint/games.go b/endpoint/games.go index c14d1a6..f35934c 100644 --- a/endpoint/games.go +++ b/endpoint/games.go @@ -35,9 +35,5 @@ func (a *Games) Query(ctx context.Context, query string) ([]*pb.Game, error) { return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Games) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Games, nil } diff --git a/endpoint/genres.go b/endpoint/genres.go index c2d86e2..9eba048 100644 --- a/endpoint/genres.go +++ b/endpoint/genres.go @@ -35,9 +35,5 @@ func (a *Genres) Query(ctx context.Context, query string) ([]*pb.Genre, error) { return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Genres) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Genres, nil } diff --git a/endpoint/involved_companies.go b/endpoint/involved_companies.go index 0ae0462..51f9fd3 100644 --- a/endpoint/involved_companies.go +++ b/endpoint/involved_companies.go @@ -35,9 +35,5 @@ func (a *InvolvedCompanies) Query(ctx context.Context, query string) ([]*pb.Invo return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Involvedcompanies) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Involvedcompanies, nil } diff --git a/endpoint/keywords.go b/endpoint/keywords.go index dd4b7ff..317cd79 100644 --- a/endpoint/keywords.go +++ b/endpoint/keywords.go @@ -35,9 +35,5 @@ func (a *Keywords) Query(ctx context.Context, query string) ([]*pb.Keyword, erro return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Keywords) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Keywords, nil } diff --git a/endpoint/language_support_types.go b/endpoint/language_support_types.go index 375b5a3..e34d864 100644 --- a/endpoint/language_support_types.go +++ b/endpoint/language_support_types.go @@ -35,9 +35,5 @@ func (a *LanguageSupportTypes) Query(ctx context.Context, query string) ([]*pb.L return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Languagesupporttypes) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Languagesupporttypes, nil } diff --git a/endpoint/language_supports.go b/endpoint/language_supports.go index 9c953c2..5321a3d 100644 --- a/endpoint/language_supports.go +++ b/endpoint/language_supports.go @@ -35,9 +35,5 @@ func (a *LanguageSupports) Query(ctx context.Context, query string) ([]*pb.Langu return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Languagesupports) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Languagesupports, nil } diff --git a/endpoint/languages.go b/endpoint/languages.go index a41a993..843df21 100644 --- a/endpoint/languages.go +++ b/endpoint/languages.go @@ -35,9 +35,5 @@ func (a *Languages) Query(ctx context.Context, query string) ([]*pb.Language, er return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Languages) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Languages, nil } diff --git a/endpoint/multiplayer_modes.go b/endpoint/multiplayer_modes.go index 31c441e..967dc43 100644 --- a/endpoint/multiplayer_modes.go +++ b/endpoint/multiplayer_modes.go @@ -35,9 +35,5 @@ func (a *MultiplayerModes) Query(ctx context.Context, query string) ([]*pb.Multi return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Multiplayermodes) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Multiplayermodes, nil } diff --git a/endpoint/network_types.go b/endpoint/network_types.go index cae9e0b..4a0638b 100644 --- a/endpoint/network_types.go +++ b/endpoint/network_types.go @@ -35,9 +35,5 @@ func (a *NetworkTypes) Query(ctx context.Context, query string) ([]*pb.NetworkTy return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Networktypes) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Networktypes, nil } diff --git a/endpoint/platform_families.go b/endpoint/platform_families.go index de8a698..8d5503d 100644 --- a/endpoint/platform_families.go +++ b/endpoint/platform_families.go @@ -35,9 +35,5 @@ func (a *PlatformFamilies) Query(ctx context.Context, query string) ([]*pb.Platf return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Platformfamilies) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Platformfamilies, nil } diff --git a/endpoint/platform_logos.go b/endpoint/platform_logos.go index 5895814..f78803e 100644 --- a/endpoint/platform_logos.go +++ b/endpoint/platform_logos.go @@ -35,9 +35,5 @@ func (a *PlatformLogos) Query(ctx context.Context, query string) ([]*pb.Platform return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Platformlogos) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Platformlogos, nil } diff --git a/endpoint/platform_types.go b/endpoint/platform_types.go index f14880a..f938d74 100644 --- a/endpoint/platform_types.go +++ b/endpoint/platform_types.go @@ -35,9 +35,5 @@ func (a *PlatformTypes) Query(ctx context.Context, query string) ([]*pb.Platform return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Platformtypes) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Platformtypes, nil } diff --git a/endpoint/platform_version_companies.go b/endpoint/platform_version_companies.go index 1c17f92..1ff0b76 100644 --- a/endpoint/platform_version_companies.go +++ b/endpoint/platform_version_companies.go @@ -35,9 +35,5 @@ func (a *PlatformVersionCompanies) Query(ctx context.Context, query string) ([]* return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Platformversioncompanies) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Platformversioncompanies, nil } diff --git a/endpoint/platform_version_release_dates.go b/endpoint/platform_version_release_dates.go index 98a51d4..d2d6934 100644 --- a/endpoint/platform_version_release_dates.go +++ b/endpoint/platform_version_release_dates.go @@ -35,9 +35,5 @@ func (a *PlatformVersionReleaseDates) Query(ctx context.Context, query string) ( return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Platformversionreleasedates) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Platformversionreleasedates, nil } diff --git a/endpoint/platform_versions.go b/endpoint/platform_versions.go index b1b24a0..9b74bac 100644 --- a/endpoint/platform_versions.go +++ b/endpoint/platform_versions.go @@ -35,9 +35,5 @@ func (a *PlatformVersions) Query(ctx context.Context, query string) ([]*pb.Platf return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Platformversions) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Platformversions, nil } diff --git a/endpoint/platform_websites.go b/endpoint/platform_websites.go index 7ba2504..addb8d0 100644 --- a/endpoint/platform_websites.go +++ b/endpoint/platform_websites.go @@ -35,9 +35,5 @@ func (a *PlatformWebsites) Query(ctx context.Context, query string) ([]*pb.Platf return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Platformwebsites) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Platformwebsites, nil } diff --git a/endpoint/platforms.go b/endpoint/platforms.go index ed2c084..16f3635 100644 --- a/endpoint/platforms.go +++ b/endpoint/platforms.go @@ -35,8 +35,5 @@ func (a *Platforms) Query(ctx context.Context, query string) ([]*pb.Platform, er return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Platforms) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } return data.Platforms, nil } diff --git a/endpoint/player_perspectives.go b/endpoint/player_perspectives.go index 043b554..cdfd76d 100644 --- a/endpoint/player_perspectives.go +++ b/endpoint/player_perspectives.go @@ -35,9 +35,5 @@ func (a *PlayerPerspectives) Query(ctx context.Context, query string) ([]*pb.Pla return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Playerperspectives) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Playerperspectives, nil } diff --git a/endpoint/popularity_primitives.go b/endpoint/popularity_primitives.go index 26a5456..38c1d8a 100644 --- a/endpoint/popularity_primitives.go +++ b/endpoint/popularity_primitives.go @@ -35,9 +35,5 @@ func (a *PopularityPrimitives) Query(ctx context.Context, query string) ([]*pb.P return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Popularityprimitives) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Popularityprimitives, nil } diff --git a/endpoint/popularity_types.go b/endpoint/popularity_types.go index 11ec807..9719643 100644 --- a/endpoint/popularity_types.go +++ b/endpoint/popularity_types.go @@ -35,9 +35,5 @@ func (a *PopularityTypes) Query(ctx context.Context, query string) ([]*pb.Popula return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Popularitytypes) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Popularitytypes, nil } diff --git a/endpoint/regions.go b/endpoint/regions.go index 7c72150..42eb84d 100644 --- a/endpoint/regions.go +++ b/endpoint/regions.go @@ -35,9 +35,5 @@ func (a *Regions) Query(ctx context.Context, query string) ([]*pb.Region, error) return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Regions) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Regions, nil } diff --git a/endpoint/release_date_regions.go b/endpoint/release_date_regions.go index ecb8ae3..49d48f7 100644 --- a/endpoint/release_date_regions.go +++ b/endpoint/release_date_regions.go @@ -35,9 +35,5 @@ func (a *ReleaseDateRegions) Query(ctx context.Context, query string) ([]*pb.Rel return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Releasedateregions) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Releasedateregions, nil } diff --git a/endpoint/release_date_statuses.go b/endpoint/release_date_statuses.go index 3c90fe4..b04127d 100644 --- a/endpoint/release_date_statuses.go +++ b/endpoint/release_date_statuses.go @@ -35,9 +35,5 @@ func (a *ReleaseDateStatuses) Query(ctx context.Context, query string) ([]*pb.Re return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Releasedatestatuses) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Releasedatestatuses, nil } diff --git a/endpoint/release_dates.go b/endpoint/release_dates.go index 516e32a..5fa9076 100644 --- a/endpoint/release_dates.go +++ b/endpoint/release_dates.go @@ -35,9 +35,5 @@ func (a *ReleaseDates) Query(ctx context.Context, query string) ([]*pb.ReleaseDa return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Releasedates) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Releasedates, nil } diff --git a/endpoint/screenshots.go b/endpoint/screenshots.go index 90bceb1..971a9fd 100644 --- a/endpoint/screenshots.go +++ b/endpoint/screenshots.go @@ -35,9 +35,5 @@ func (a *Screenshots) Query(ctx context.Context, query string) ([]*pb.Screenshot return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Screenshots) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Screenshots, nil } diff --git a/endpoint/search.go b/endpoint/search.go index aa16db5..bc2867b 100644 --- a/endpoint/search.go +++ b/endpoint/search.go @@ -46,10 +46,6 @@ func (a *Search) Search(ctx context.Context, query string) ([]*pb.Search, error) return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Searches) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Searches, nil } diff --git a/endpoint/themes.go b/endpoint/themes.go index 1d9bfab..8feddf1 100644 --- a/endpoint/themes.go +++ b/endpoint/themes.go @@ -35,9 +35,5 @@ func (a *Themes) Query(ctx context.Context, query string) ([]*pb.Theme, error) { return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Themes) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Themes, nil } diff --git a/endpoint/website_types.go b/endpoint/website_types.go index 86567db..baefe34 100644 --- a/endpoint/website_types.go +++ b/endpoint/website_types.go @@ -35,9 +35,5 @@ func (a *WebsiteTypes) Query(ctx context.Context, query string) ([]*pb.WebsiteTy return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Websitetypes) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Websitetypes, nil } diff --git a/endpoint/websites.go b/endpoint/websites.go index 228116f..c13640b 100644 --- a/endpoint/websites.go +++ b/endpoint/websites.go @@ -35,9 +35,5 @@ func (a *Websites) Query(ctx context.Context, query string) ([]*pb.Website, erro return nil, fmt.Errorf("failed to unmarshal: %w", err) } - if len(data.Websites) == 0 { - return nil, fmt.Errorf("no results: %s", query) - } - return data.Websites, nil }