# struct use MarshalIndent dataByte, err := json.MarshalIndent(v, "", " ") # str json use gjson @pretty gjson.Get(task.Config, "@pretty").String()