Skip to content

Conversation

@miladev95
Copy link
Contributor

@miladev95 miladev95 commented Nov 17, 2025

  • [ X] Do only one thing
  • [ X] Non breaking API changes
  • [ X] Tested

What did this pull request do?

Handle the previously unhandled error from the Cobra required flag setup. Wrap cmd.MarkFlagRequired("input") with cobra.CheckErr(...) in internal/gen/gen.go so setup failures print usage and exit non‑zero.

User Case Description

ensuring misconfiguration is caught.


Handle MarkFlagRequired("input") Error with cobra.CheckErr

Replaces the direct call to cmd.MarkFlagRequired("input") with cobra.CheckErr(cmd.MarkFlagRequired("input")) in internal/gen/gen.go. This ensures any failure during flag-setup is surfaced to users and the CLI exits with a non-zero status.

Key Changes

• Wrapped cmd.MarkFlagRequired("input") with cobra.CheckErr(...)

Affected Areas

internal/gen/gen.go (CLI flag initialization for the gen command)


This summary was automatically generated by @propel-code-bot

@jinzhu jinzhu merged commit a94e55e into go-gorm:master Nov 22, 2025
3 checks passed
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