Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[generator] Document how to use the generator in a fork #6

Closed
kakwa opened this issue May 8, 2023 · 3 comments
Closed

[generator] Document how to use the generator in a fork #6

kakwa opened this issue May 8, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@kakwa
Copy link
Contributor

kakwa commented May 8, 2023

When fixing the generator (patchs.go fixes), a contributor needs to build the local patched version.

However go build -o generator github.com/IceflowRE/go-wargaming/v4/tools/generator (like instructed in the README) will build the unpatched version from the upstream repository, not the local checkout.

It's possible to build the generator locally (go build -o generator tools/_generator/main.go, but it has other side effects, mainly messing-up the imports:

 import (
-       "github.com/IceflowRE/go-wargaming/v4/wargaming/wgnTime"
+       "/wargaming/wgnTime"
 )

Put also adding // spacing comment lines:

 // 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.

My go version:

> go version
go version go1.19.8 linux/amd64
@IceflowRE
Copy link
Owner

Woops. Will take a look.

@IceflowRE IceflowRE added the bug Something isn't working label May 10, 2023
@IceflowRE
Copy link
Owner

IceflowRE commented May 12, 2023

I could not reproduce the local build failure.
If i do

go build -o generator github.com/IceflowRE/go-wargaming/v4/tools/_generator

it will build from the local version.
Probably you had the newest version and did

go build -o generator github.com/IceflowRE/go-wargaming/v4/tools/generator

Note the missing underscore. I added the underscore, that the tools wont be delivered when doing go get. This might have been the issue here.
Will update the readme.

@IceflowRE
Copy link
Owner

The generator generation should be correct now. The formatting is continued here #8 .
If i am wrong please reopen, with additional information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants