Currently, it only supports: string, float32/64, and int...which covers my use-case, but I'd like to cover future situations, and anyone that might find this code useful.
Below is a cross-section link of where the type switch is located:
|
switch value.(type) { |
|
case string: |
|
return data + fmt.Sprintf("\"%s\"%s\n", EscapeJson(value.(string)), commaString) |
|
case float32: |
|
return data + fmt.Sprintf("\"%f\"%s\n", value, commaString) |
|
case float64: |
|
return data + fmt.Sprintf("\"%f\"%s\n", value, commaString) |
|
default: |
|
return data + fmt.Sprintf("%d%s\n", value, commaString) |
|
} |
Currently, it only supports: string, float32/64, and int...which covers my use-case, but I'd like to cover future situations, and anyone that might find this code useful.
Below is a cross-section link of where the type switch is located:
jsonbuilder/jsonbuilder.go
Lines 60 to 69 in 62be5b5