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

When marshaling To go code, option to not marshall zero values #302

Open
thomaspeugeot opened this issue Mar 9, 2023 · 0 comments
Open
Assignees

Comments

@thomaspeugeot
Copy link
Contributor

thomaspeugeot commented Mar 9, 2023

Rationale for the change is to limit the size of the go persistance file.

A drawback is that the values cannot be easily set if the file is missing. Solution is to have an option in the persistance.

func Zero[T any]() (_ T) {
  return
}

func main() {

  fmt.Println("%v", Zero[int]()) 
}
@thomaspeugeot thomaspeugeot changed the title When marshaling To go code, spare zero values When marshaling To go code, option to not marshall zero values Mar 9, 2023
@thomaspeugeot thomaspeugeot self-assigned this Sep 6, 2023
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

No branches or pull requests

1 participant