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

Capitalize all variant names when configuration specifies so in Go #183

Merged

Conversation

hculea
Copy link
Member

@hculea hculea commented Jul 16, 2024

Before this MR, when generating Go types with algebraic enums and specifying uppercase acronyms, this would happen:

func (i ItemFieldDetails) OTP() *OtpFieldDetails {
	res, _ := i.content.(*OtpFieldDetails)
	return res
}

// Additional attributes for OTP fields.
type OTPFieldDetails struct {
	// The OTP code, if successfully computed
	Code *string `json:"code,omitempty"`
	// The error message, if the OTP code could not be computed
	ErrorMessage *string `json:"error_message,omitempty"`
}

The uppercasing was not enforced consistently, causing the Go types to error because of their different capitalization: OTPFieldDetails vs OtpFieldDetails.

This MR fixes this.

@srriddle srriddle merged commit aecde79 into 1Password:main Jul 18, 2024
5 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.

None yet

3 participants