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

Codegen should be smart enough to cast or assert the value #128

Open
si3nloong opened this issue Sep 19, 2024 · 0 comments
Open

Codegen should be smart enough to cast or assert the value #128

si3nloong opened this issue Sep 19, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request go Pull requests that update Go code good first issue Good for newcomers

Comments

@si3nloong
Copy link
Owner

si3nloong commented Sep 19, 2024

Currently if we have the following struct.

type A struct {
   Str string
}

It will generate the following functions.

func (v A) Values() []any{
  return []any{(string)(v.Str)}
}

Which don't required a type casting, unless the underlying type is not basic type.

Basic types are : string, []byte, sql.RawBytes, int64, float64, time.Time

@si3nloong si3nloong self-assigned this Oct 7, 2024
@si3nloong si3nloong added enhancement New feature or request good first issue Good for newcomers go Pull requests that update Go code labels Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request go Pull requests that update Go code good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant