Skip to content

Harmonize output formats #85

Closed
Closed
@mancha1

Description

@mancha1

Hello Alexandre. Many thanks for your great work on this.

A small report: unlike JSON and XML output, CSV-formatted output skips the IP field and begins with the country code. I'm go-ignorant but the below patch might do the trick.

--mancha

--- a/encoder.go
+++ b/encoder.go
@@ -137,6 +137,7 @@ func (f *CSVEncoder) Encode(w http.Respo
        cw := csv.NewWriter(w)
        cw.UseCRLF = f.UseCRLF
        err := cw.Write([]string{
+               record.IP,
                record.CountryCode,
                record.CountryName,
                record.RegionCode,

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