Skip to content
This repository was archived by the owner on Dec 15, 2025. It is now read-only.
This repository was archived by the owner on Dec 15, 2025. It is now read-only.

MarshalIndent 方法内漏掉了对 extensions 的拷贝 #293

@yelo-17133

Description

@yelo-17133

func (cfg *frozenConfig) MarshalIndent(v interface{}, prefix, indent string) ([]byte, error) {

newCfg := cfg.configBeforeFrozen
newCfg.IndentionStep = len(indent)
return newCfg.frozeWithCacheReuse().Marshal(v)

to:
newCfg := cfg.configBeforeFrozen
newCfg.IndentionStep = len(indent)
newFrozenCfg := newCfg.frozeWithCacheReuse();
newFrozenCfg.extensions = cfg.extensions
return newFrozenCfg.Marshal(v)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions