79756772

Date: 2025-09-05 12:35:28
Score: 4
Natty: 4.5
Report link

How did you go about doing the re-ordering? I am struggling with the same problem for maps, but I cannot get my ordering right without ruining the structure

for example:

This:

var strStatus = map[Status]string{
    StatusInvalid:  "Invalid",
    StatusCreated:  "Created",
    StatusDisabled: "Disabled",
    StatusActive:   "Active",
    StatusInactive: "Inactive",
}

Becomes This:

var strStatus = map[Status]string{StatusActive: "Active", StatusCreated: "Created",
    StatusDisabled: "Disabled",

    StatusInactive: "Inactive", StatusInvalid: "Invalid"}

I don't want to have to do find and replace with and search for commas and so on, so how did you go about maintaining the output format?

Reasons:
  • Blacklisted phrase (1): I am struggling
  • Blacklisted phrase (0.5): I cannot
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Starts with a question (0.5): How did you
  • Low reputation (1):
Posted by: Kyle Norris