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

opt: encoder support Uint64ToString and Int64ToString #723

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions api.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ type Config struct {

// Encode Infinity or Nan float into `null`, instead of returning an error.
EncodeNullForInfOrNan bool

// Uint64 into strings on Marshal
Uint64ToString bool
Copy link
Collaborator

Choose a reason for hiding this comment

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

为啥不需要Int64呢?我的意思是Int64和Uint64都用一个选项控制就行了

Copy link
Author

Choose a reason for hiding this comment

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

😓😓,我们是PHP(c++扩展)迁移go的,老逻辑只处理了uint64,int64没处理。如果同一个选项控制,会有大量diff😅
所以我给分开了,10多年的老代码了,diff太多迁移成本剧增🤡

Copy link
Author

@period331 period331 Dec 19, 2024

Choose a reason for hiding this comment

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

@AsterDY 你看可以不?要么两个选项,要么只有一个uint64的选项,如果合并到一起,我们这边就用不了了😂😂😂

Copy link
Collaborator

Choose a reason for hiding this comment

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

那就分开吧

}

var (
Expand Down
Loading
Loading