Skip to content

GetLine(): Add expanded type support. #2

@steviesama

Description

@steviesama

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)
}

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions