Skip to content

Running AddString inside for makes app crash #32

@marciowinicius

Description

@marciowinicius

When I make something like this :
`
builder := dynamicstruct.NewBuilder()
row := make(map[string]interface{})
for k, v := range searchable {
builder.AddString(k)
row[k] = v
}
dataJsonStr, err := json.Marshal(data)
builder.AddString("Data")
row["Data"] = string(dataJsonStr)
builder.AddString("Key")
row["Key"] = key
builder.AddString("Timestamp")
time.Local, _ = time.LoadLocation("America/Sao_Paulo")
row["Timestamp"] = time.Now().String()
builder.AddInt("LogType")
row["LogType"] = logType
ds, _ := builder.Build()
dec, _ := ds.DecodeMap(row)

`
My APP crashes.
When I remove the builder.AddString(k) inside the for, everything works fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions