Skip to content

Conversation

@chaokunyang
Copy link
Collaborator

@chaokunyang chaokunyang commented Jan 11, 2026

Why?

The Fory Go implementation needs comprehensive documentation to help users understand how to use the serialization library effectively. Additionally, the public API naming needed improvement for better clarity and consistency.

What does this PR do?

Documentation (13 new guide documents)

Added comprehensive documentation for Fory Go under docs/guide/go/:

  • basic-serialization.md: Core serialization APIs (Serialize/Deserialize, Marshal/Unmarshal)
  • configuration.md: Configuration options (TrackRef, MaxDepth, etc.)
  • type-registration.md: How to register structs and enums with IDs or names
  • supported-types.md: All supported Go types (primitives, collections, structs, etc.)
  • struct-tags.md: Using struct tags for field customization
  • references.md: Reference tracking and circular reference handling
  • schema-evolution.md: Compatible mode and schema evolution support
  • cross-language.md: Cross-language serialization with Java, Python, Rust, etc.
  • custom-serializers.md: Implementing custom serializers
  • codegen.md: Code generation for performance optimization
  • thread-safety.md: Thread-safe usage with ForyPool
  • troubleshooting.md: Common errors and solutions
  • index.md: Overview and quick start guide

Also updated:

  • go/README.md: Updated with new API examples
  • docs/guide/xlang/field-reference-tracking.md: Added Go examples

API Changes

Renamed registration methods for better clarity and consistency:

Old Name New Name
Register() RegisterStruct()
RegisterByName() RegisterNamedStruct()
RegisterEnumByName() RegisterNamedEnum()

Default Configuration Changes

  • MaxDepth: Changed from 100 to 20 (more reasonable default)
  • IsXlang: Changed from true to false (native mode as default)

Code Improvements

  • Updated serializers to use consistent patterns
  • Fixed codegen templates to use new API names
  • Updated all tests to use new registration API

Related issues

#2982

Does this PR introduce any user-facing change?

  • Does this PR introduce any public API change?
    • Registration method renames (see table above)
    • Default configuration changes
  • Does this PR introduce any binary protocol compatibility change?

@chaokunyang chaokunyang mentioned this pull request Jan 11, 2026
17 tasks
Add extensionSerializerAdapter which wraps ExtensionSerializer to implement
the full Serializer interface, handling reference tracking and type info.
@chaokunyang chaokunyang force-pushed the add_go_serde_doc branch 2 times, most recently from 31ff58a to 39f5145 Compare January 12, 2026 03:19
@chaokunyang chaokunyang merged commit ce976a6 into apache:main Jan 12, 2026
53 checks passed
chaokunyang added a commit that referenced this pull request Jan 12, 2026
## Why?



## What does this PR do?



## Related issues

#3121 

## Does this PR introduce any user-facing change?



- [ ] Does this PR introduce any public API change?
- [ ] Does this PR introduce any binary protocol compatibility change?

## Benchmark
chaokunyang added a commit that referenced this pull request Jan 12, 2026
## Why?



## What does this PR do?



## Related issues
#3121 
## Does this PR introduce any user-facing change?



- [ ] Does this PR introduce any public API change?
- [ ] Does this PR introduce any binary protocol compatibility change?

## Benchmark
chaokunyang added a commit that referenced this pull request Jan 12, 2026
## Why?



## What does this PR do?



## Related issues

#3121 

## Does this PR introduce any user-facing change?



- [ ] Does this PR introduce any public API change?
- [ ] Does this PR introduce any binary protocol compatibility change?

## Benchmark
chaokunyang added a commit that referenced this pull request Jan 12, 2026
## Why?



## What does this PR do?



## Related issues

#2982 
#3121 

## Does this PR introduce any user-facing change?



- [ ] Does this PR introduce any public API change?
- [ ] Does this PR introduce any binary protocol compatibility change?

## Benchmark
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