Skip to content

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

Closed
@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