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

Only assert if go package is present if generating go types #211

Merged
merged 6 commits into from
Nov 18, 2024

Conversation

MOmarMiraj
Copy link
Contributor

@MOmarMiraj MOmarMiraj commented Nov 18, 2024

As apart of !184 there has been a regression as if you build typeshare with all features and are typesharing not in Golang, the assert_go_package_is_present function will still be ran even though your generating for another language

Updated the code to only run the function if the language of the types being converted is Golang.

To test:
Download the latest typeshare-cli from main and try generating types for any language but Go without a --go-package in the cmd and a package in the typeshare.toml.Should error out with:

[2024-11-18 15:50:43.169602 -05:00] INFO [typeshare] cli/src/main.rs:49: typeshare started generating types
Error: Please provide a package name in the typeshare.toml or using --go-package <package name>

Try the same thing but install from my branch like so:

	cargo install --git https://github.com/MOmarMiraj/typeshare --branch omar/fix-go-package --features go

and should work as expected.

cli/src/main.rs Outdated Show resolved Hide resolved
Copy link
Member

@darrell-roberts darrell-roberts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requested change.

@darrell-roberts darrell-roberts merged commit e0e5f27 into 1Password:main Nov 18, 2024
6 checks passed
@MOmarMiraj MOmarMiraj deleted the omar/fix-go-package branch November 18, 2024 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants