Skip to content

Commit

Permalink
[*] Fix format bug
Browse files Browse the repository at this point in the history
Close #8
  • Loading branch information
IceflowRE committed Sep 12, 2023
1 parent e377ffa commit 19b6994
Show file tree
Hide file tree
Showing 182 changed files with 834 additions and 355 deletions.
4 changes: 2 additions & 2 deletions tools/generator/internal/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package internal
import (
"bytes"
_ "embed"
"fmt"
"go/format"
"os"
"regexp"
Expand All @@ -14,9 +13,10 @@ import (
)

func formatWriteFile(buf []byte, outputPath string) error {
// https://github.com/golang/go/issues/62559
buf = bytes.ReplaceAll(buf, []byte("\r\n"), []byte("\n"))
content, err := format.Source(buf)
if err != nil {
fmt.Println(string(buf))
return err
}
outFile, err := os.Create(outputPath)
Expand Down
7 changes: 5 additions & 2 deletions wargaming/wgn_account_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ import (
// https://developers.wargaming.net/reference/all/wgn/account/info
//
// realm:
// Valid realms: RealmEu, RealmNa
//
// Valid realms: RealmEu, RealmNa
//
// accountId:
// Player ID. Maximum limit: 100.
//
// Player ID. Maximum limit: 100.
func (service *WgnService) AccountInfo(ctx context.Context, realm Realm, accountId []int, options *wgn.AccountInfoOptions) (*wgn.AccountInfo, *GenericMeta, error) {
if err := validateRealm(realm, []Realm{RealmEu, RealmNa}); err != nil {
return nil, nil, err
Expand Down
7 changes: 5 additions & 2 deletions wargaming/wgn_account_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ import (
// https://developers.wargaming.net/reference/all/wgn/account/list
//
// realm:
// Valid realms: RealmAsia, RealmEu, RealmNa
//
// Valid realms: RealmAsia, RealmEu, RealmNa
//
// search:
// Player name search string. Parameter "type" defines minimum length and type of search. Using the exact search type, you can enter several names, separated with commas. Maximum length: 24.
//
// Player name search string. Parameter "type" defines minimum length and type of search. Using the exact search type, you can enter several names, separated with commas. Maximum length: 24.
func (service *WgnService) AccountList(ctx context.Context, realm Realm, search string, options *wgn.AccountListOptions) ([]*wgn.AccountList, *GenericMeta, error) {
if err := validateRealm(realm, []Realm{RealmAsia, RealmEu, RealmNa}); err != nil {
return nil, nil, err
Expand Down
3 changes: 2 additions & 1 deletion wargaming/wgn_clans_glossary.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import (
// Deprecated: Attention! The method is deprecated.
//
// realm:
// Valid realms: RealmAsia, RealmEu, RealmNa
//
// Valid realms: RealmAsia, RealmEu, RealmNa
func (service *WgnService) ClansGlossary(ctx context.Context, realm Realm, options *wgn.ClansGlossaryOptions) (*wgn.ClansGlossary, error) {
if err := validateRealm(realm, []Realm{RealmAsia, RealmEu, RealmNa}); err != nil {
return nil, err
Expand Down
7 changes: 5 additions & 2 deletions wargaming/wgn_clans_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@ import (
// Deprecated: Attention! The method is deprecated.
//
// realm:
// Valid realms: RealmAsia, RealmEu, RealmNa
//
// Valid realms: RealmAsia, RealmEu, RealmNa
//
// clanId:
// Clan ID. Maximum limit: 100.
//
// Clan ID. Maximum limit: 100.
func (service *WgnService) ClansInfo(ctx context.Context, realm Realm, clanId []int, options *wgn.ClansInfoOptions) (*wgn.ClansInfo, error) {
if err := validateRealm(realm, []Realm{RealmAsia, RealmEu, RealmNa}); err != nil {
return nil, err
Expand Down
3 changes: 2 additions & 1 deletion wargaming/wgn_clans_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ import (
// Deprecated: Attention! The method is deprecated.
//
// realm:
// Valid realms: RealmAsia, RealmEu, RealmNa
//
// Valid realms: RealmAsia, RealmEu, RealmNa
func (service *WgnService) ClansList(ctx context.Context, realm Realm, options *wgn.ClansListOptions) (*wgn.ClansList, error) {
if err := validateRealm(realm, []Realm{RealmAsia, RealmEu, RealmNa}); err != nil {
return nil, err
Expand Down
7 changes: 5 additions & 2 deletions wargaming/wgn_clans_memberhistory.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@ import (
// Deprecated: Attention! The method is deprecated.
//
// realm:
// Valid realms: RealmAsia, RealmEu, RealmNa
//
// Valid realms: RealmAsia, RealmEu, RealmNa
//
// accountId:
// Account ID. Min value is 1.
//
// Account ID. Min value is 1.
func (service *WgnService) ClansMemberhistory(ctx context.Context, realm Realm, accountId int, options *wgn.ClansMemberhistoryOptions) (*wgn.ClansMemberhistory, error) {
if err := validateRealm(realm, []Realm{RealmAsia, RealmEu, RealmNa}); err != nil {
return nil, err
Expand Down
7 changes: 5 additions & 2 deletions wargaming/wgn_clans_membersinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@ import (
// Deprecated: Attention! The method is deprecated.
//
// realm:
// Valid realms: RealmAsia, RealmEu, RealmNa
//
// Valid realms: RealmAsia, RealmEu, RealmNa
//
// accountId:
// Account ID. Maximum limit: 100. Min value is 1.
//
// Account ID. Maximum limit: 100. Min value is 1.
func (service *WgnService) ClansMembersinfo(ctx context.Context, realm Realm, accountId []int, options *wgn.ClansMembersinfoOptions) (*wgn.ClansMembersinfo, error) {
if err := validateRealm(realm, []Realm{RealmAsia, RealmEu, RealmNa}); err != nil {
return nil, err
Expand Down
7 changes: 5 additions & 2 deletions wargaming/wgn_clans_messageboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ import (
// Deprecated: Attention! The method is deprecated.
//
// realm:
// Valid realms: RealmAsia, RealmEu, RealmNa
//
// Valid realms: RealmAsia, RealmEu, RealmNa
//
// accessToken:
// Access token for the private data of a user's account; can be received via the authorization method; valid within a stated time period
//
// Access token for the private data of a user's account; can be received via the authorization method; valid within a stated time period
func (service *WgnService) ClansMessageboard(ctx context.Context, realm Realm, accessToken string, options *wgn.ClansMessageboardOptions) (*wgn.ClansMessageboard, error) {
if err := validateRealm(realm, []Realm{RealmAsia, RealmEu, RealmNa}); err != nil {
return nil, err
Expand Down
3 changes: 2 additions & 1 deletion wargaming/wgn_servers_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import (
// https://developers.wargaming.net/reference/all/wgn/servers/info
//
// realm:
// Valid realms: RealmAsia, RealmEu, RealmNa
//
// Valid realms: RealmAsia, RealmEu, RealmNa
func (service *WgnService) ServersInfo(ctx context.Context, realm Realm, options *wgn.ServersInfoOptions) (*wgn.ServersInfo, error) {
if err := validateRealm(realm, []Realm{RealmAsia, RealmEu, RealmNa}); err != nil {
return nil, err
Expand Down
3 changes: 2 additions & 1 deletion wargaming/wgn_wgtv_tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import (
// https://developers.wargaming.net/reference/all/wgn/wgtv/tags
//
// realm:
// Valid realms: RealmAsia, RealmEu, RealmNa
//
// Valid realms: RealmAsia, RealmEu, RealmNa
func (service *WgnService) WgtvTags(ctx context.Context, realm Realm, options *wgn.WgtvTagsOptions) (*wgn.WgtvTags, *GenericMeta, error) {
if err := validateRealm(realm, []Realm{RealmAsia, RealmEu, RealmNa}); err != nil {
return nil, nil, err
Expand Down
3 changes: 2 additions & 1 deletion wargaming/wgn_wgtv_vehicles.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import (
// https://developers.wargaming.net/reference/all/wgn/wgtv/vehicles
//
// realm:
// Valid realms: RealmAsia, RealmEu, RealmNa
//
// Valid realms: RealmAsia, RealmEu, RealmNa
func (service *WgnService) WgtvVehicles(ctx context.Context, realm Realm, options *wgn.WgtvVehiclesOptions) (*wgn.WgtvVehicles, *GenericMeta, error) {
if err := validateRealm(realm, []Realm{RealmAsia, RealmEu, RealmNa}); err != nil {
return nil, nil, err
Expand Down
3 changes: 2 additions & 1 deletion wargaming/wgn_wgtv_videos.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import (
// https://developers.wargaming.net/reference/all/wgn/wgtv/videos
//
// realm:
// Valid realms: RealmAsia, RealmEu, RealmNa
//
// Valid realms: RealmAsia, RealmEu, RealmNa
func (service *WgnService) WgtvVideos(ctx context.Context, realm Realm, options *wgn.WgtvVideosOptions) ([]*wgn.WgtvVideos, *GenericMeta, error) {
if err := validateRealm(realm, []Realm{RealmAsia, RealmEu, RealmNa}); err != nil {
return nil, nil, err
Expand Down
7 changes: 5 additions & 2 deletions wargaming/wot_account_achievements.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ import (
// https://developers.wargaming.net/reference/all/wot/account/achievements
//
// realm:
// Valid realms: RealmAsia, RealmEu, RealmNa
//
// Valid realms: RealmAsia, RealmEu, RealmNa
//
// accountId:
// Player account ID. Maximum limit: 100.
//
// Player account ID. Maximum limit: 100.
func (service *WotService) AccountAchievements(ctx context.Context, realm Realm, accountId []int, options *wot.AccountAchievementsOptions) (*wot.AccountAchievements, *GenericMeta, error) {
if err := validateRealm(realm, []Realm{RealmAsia, RealmEu, RealmNa}); err != nil {
return nil, nil, err
Expand Down
7 changes: 5 additions & 2 deletions wargaming/wot_account_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ import (
// https://developers.wargaming.net/reference/all/wot/account/info
//
// realm:
// Valid realms: RealmAsia, RealmEu, RealmNa
//
// Valid realms: RealmAsia, RealmEu, RealmNa
//
// accountId:
// Player account ID. Maximum limit: 100.
//
// Player account ID. Maximum limit: 100.
func (service *WotService) AccountInfo(ctx context.Context, realm Realm, accountId []int, options *wot.AccountInfoOptions) (*wot.AccountInfo, *GenericMeta, error) {
if err := validateRealm(realm, []Realm{RealmAsia, RealmEu, RealmNa}); err != nil {
return nil, nil, err
Expand Down
7 changes: 5 additions & 2 deletions wargaming/wot_account_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ import (
// https://developers.wargaming.net/reference/all/wot/account/list
//
// realm:
// Valid realms: RealmAsia, RealmEu, RealmNa
//
// Valid realms: RealmAsia, RealmEu, RealmNa
//
// search:
// Player name search string. Parameter "type" defines minimum length and type of search. Using the exact search type, you can enter several names, separated with commas. Maximum length: 24.
//
// Player name search string. Parameter "type" defines minimum length and type of search. Using the exact search type, you can enter several names, separated with commas. Maximum length: 24.
func (service *WotService) AccountList(ctx context.Context, realm Realm, search string, options *wot.AccountListOptions) ([]*wot.AccountList, *GenericMeta, error) {
if err := validateRealm(realm, []Realm{RealmAsia, RealmEu, RealmNa}); err != nil {
return nil, nil, err
Expand Down
7 changes: 5 additions & 2 deletions wargaming/wot_account_tanks.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ import (
// https://developers.wargaming.net/reference/all/wot/account/tanks
//
// realm:
// Valid realms: RealmAsia, RealmEu, RealmNa
//
// Valid realms: RealmAsia, RealmEu, RealmNa
//
// accountId:
// Player account ID. Maximum limit: 100.
//
// Player account ID. Maximum limit: 100.
func (service *WotService) AccountTanks(ctx context.Context, realm Realm, accountId []int, options *wot.AccountTanksOptions) (map[string][]*wot.AccountTanks, *GenericMeta, error) {
if err := validateRealm(realm, []Realm{RealmAsia, RealmEu, RealmNa}); err != nil {
return nil, nil, err
Expand Down
9 changes: 6 additions & 3 deletions wargaming/wot_auth_login.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ import (

// AuthLogin authenticates user based on Wargaming.net ID (OpenID) which is used in World of Tanks, World of Tanks Blitz, World of Warships, World of Warplanes, and WarGag.ru. To log in, player must enter email and password used for creating account, or use a social network profile.
// Authentication is not available for iOS Game Center users in the following cases:
// the account is not linked to a social network account, or
// email and password are not specified in the profile.
//
// the account is not linked to a social network account, or
// email and password are not specified in the profile.
//
// Information on authorization status is sent to URL specified in redirect_uri parameter.
// If authentication is successful, the following parameters are sent to redirect_uri:
//
Expand All @@ -30,7 +32,8 @@ import (
// https://developers.wargaming.net/reference/all/wot/auth/login
//
// realm:
// Valid realms: RealmAsia, RealmEu, RealmNa
//
// Valid realms: RealmAsia, RealmEu, RealmNa
func (service *WotService) AuthLogin(ctx context.Context, realm Realm, options *wot.AuthLoginOptions) (*wot.AuthLogin, error) {
if err := validateRealm(realm, []Realm{RealmAsia, RealmEu, RealmNa}); err != nil {
return nil, err
Expand Down
7 changes: 5 additions & 2 deletions wargaming/wot_auth_logout.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ import (
// https://developers.wargaming.net/reference/all/wot/auth/logout
//
// realm:
// Valid realms: RealmAsia, RealmEu, RealmNa
//
// Valid realms: RealmAsia, RealmEu, RealmNa
//
// accessToken:
// Access token for the private data of a user's account; can be received via the authorization method; valid within a stated time period
//
// Access token for the private data of a user's account; can be received via the authorization method; valid within a stated time period
func (service *WotService) AuthLogout(ctx context.Context, realm Realm, accessToken string) error {
if err := validateRealm(realm, []Realm{RealmAsia, RealmEu, RealmNa}); err != nil {
return err
Expand Down
7 changes: 5 additions & 2 deletions wargaming/wot_auth_prolongate.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ import (
// https://developers.wargaming.net/reference/all/wot/auth/prolongate
//
// realm:
// Valid realms: RealmAsia, RealmEu, RealmNa
//
// Valid realms: RealmAsia, RealmEu, RealmNa
//
// accessToken:
// Access token for the private data of a user's account; can be received via the authorization method; valid within a stated time period
//
// Access token for the private data of a user's account; can be received via the authorization method; valid within a stated time period
func (service *WotService) AuthProlongate(ctx context.Context, realm Realm, accessToken string, options *wot.AuthProlongateOptions) (*wot.AuthProlongate, error) {
if err := validateRealm(realm, []Realm{RealmAsia, RealmEu, RealmNa}); err != nil {
return nil, err
Expand Down
7 changes: 5 additions & 2 deletions wargaming/wot_clanratings_clans.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ import (
// https://developers.wargaming.net/reference/all/wot/clanratings/clans
//
// realm:
// Valid realms: RealmAsia, RealmEu, RealmNa
//
// Valid realms: RealmAsia, RealmEu, RealmNa
//
// clanId:
// Clan IDs. Maximum limit: 100.
//
// Clan IDs. Maximum limit: 100.
func (service *WotService) ClanratingsClans(ctx context.Context, realm Realm, clanId []int, options *wot.ClanratingsClansOptions) (*wot.ClanratingsClans, *GenericMeta, error) {
if err := validateRealm(realm, []Realm{RealmAsia, RealmEu, RealmNa}); err != nil {
return nil, nil, err
Expand Down
3 changes: 2 additions & 1 deletion wargaming/wot_clanratings_dates.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import (
// https://developers.wargaming.net/reference/all/wot/clanratings/dates
//
// realm:
// Valid realms: RealmAsia, RealmEu, RealmNa
//
// Valid realms: RealmAsia, RealmEu, RealmNa
func (service *WotService) ClanratingsDates(ctx context.Context, realm Realm, options *wot.ClanratingsDatesOptions) (*wot.ClanratingsDates, *GenericMeta, error) {
if err := validateRealm(realm, []Realm{RealmAsia, RealmEu, RealmNa}); err != nil {
return nil, nil, err
Expand Down
11 changes: 8 additions & 3 deletions wargaming/wot_clanratings_neighbors.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,16 @@ import (
// https://developers.wargaming.net/reference/all/wot/clanratings/neighbors
//
// realm:
// Valid realms: RealmAsia, RealmEu, RealmNa
//
// Valid realms: RealmAsia, RealmEu, RealmNa
//
// clanId:
// Clan ID
//
// Clan ID
//
// rankField:
// Rating category
//
// Rating category
func (service *WotService) ClanratingsNeighbors(ctx context.Context, realm Realm, clanId int, rankField string, options *wot.ClanratingsNeighborsOptions) ([]*wot.ClanratingsNeighbors, *GenericMeta, error) {
if err := validateRealm(realm, []Realm{RealmAsia, RealmEu, RealmNa}); err != nil {
return nil, nil, err
Expand Down
7 changes: 5 additions & 2 deletions wargaming/wot_clanratings_top.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ import (
// https://developers.wargaming.net/reference/all/wot/clanratings/top
//
// realm:
// Valid realms: RealmAsia, RealmEu, RealmNa
//
// Valid realms: RealmAsia, RealmEu, RealmNa
//
// rankField:
// Rating category
//
// Rating category
func (service *WotService) ClanratingsTop(ctx context.Context, realm Realm, rankField string, options *wot.ClanratingsTopOptions) ([]*wot.ClanratingsTop, *GenericMeta, error) {
if err := validateRealm(realm, []Realm{RealmAsia, RealmEu, RealmNa}); err != nil {
return nil, nil, err
Expand Down
3 changes: 2 additions & 1 deletion wargaming/wot_clanratings_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import (
// https://developers.wargaming.net/reference/all/wot/clanratings/types
//
// realm:
// Valid realms: RealmAsia, RealmEu, RealmNa
//
// Valid realms: RealmAsia, RealmEu, RealmNa
func (service *WotService) ClanratingsTypes(ctx context.Context, realm Realm) (*wot.ClanratingsTypes, *GenericMeta, error) {
if err := validateRealm(realm, []Realm{RealmAsia, RealmEu, RealmNa}); err != nil {
return nil, nil, err
Expand Down
7 changes: 5 additions & 2 deletions wargaming/wot_clans_accountinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ import (
// https://developers.wargaming.net/reference/all/wot/clans/accountinfo
//
// realm:
// Valid realms: RealmAsia, RealmEu, RealmNa
//
// Valid realms: RealmAsia, RealmEu, RealmNa
//
// accountId:
// Account ID. Maximum limit: 100. Min value is 1.
//
// Account ID. Maximum limit: 100. Min value is 1.
func (service *WotService) ClansAccountinfo(ctx context.Context, realm Realm, accountId []int, options *wot.ClansAccountinfoOptions) (*wot.ClansAccountinfo, *GenericMeta, error) {
if err := validateRealm(realm, []Realm{RealmAsia, RealmEu, RealmNa}); err != nil {
return nil, nil, err
Expand Down
3 changes: 2 additions & 1 deletion wargaming/wot_clans_glossary.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import (
// https://developers.wargaming.net/reference/all/wot/clans/glossary
//
// realm:
// Valid realms: RealmAsia, RealmEu, RealmNa
//
// Valid realms: RealmAsia, RealmEu, RealmNa
func (service *WotService) ClansGlossary(ctx context.Context, realm Realm, options *wot.ClansGlossaryOptions) (*wot.ClansGlossary, error) {
if err := validateRealm(realm, []Realm{RealmAsia, RealmEu, RealmNa}); err != nil {
return nil, err
Expand Down
7 changes: 5 additions & 2 deletions wargaming/wot_clans_info.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,12 @@ import (
// https://developers.wargaming.net/reference/all/wot/clans/info
//
// realm:
// Valid realms: RealmAsia, RealmEu, RealmNa
//
// Valid realms: RealmAsia, RealmEu, RealmNa
//
// clanId:
// Clan ID. Maximum limit: 100.
//
// Clan ID. Maximum limit: 100.
func (service *WotService) ClansInfo(ctx context.Context, realm Realm, clanId []int, options *wot.ClansInfoOptions) (*wot.ClansInfo, *GenericMeta, error) {
if err := validateRealm(realm, []Realm{RealmAsia, RealmEu, RealmNa}); err != nil {
return nil, nil, err
Expand Down
Loading

0 comments on commit 19b6994

Please sign in to comment.