Removing repeated values from a slice of strings while keeping the original order is something nearly every program ends up writing by hand, and the standard library has nothing for it before generics and sorting-based helpers arrive. A small function here would save that copy-and-paste in every project.
Definition of done: DedupeStrings(input []string) []string returns a new slice containing each value once, in the order each value first appeared, with a doc comment and table-driven tests covering an empty slice, a nil slice, a slice with no repeats, a slice that is all the same value, and repeats that are not next to each other.
Model: opus-5
Removing repeated values from a slice of strings while keeping the original order is something nearly every program ends up writing by hand, and the standard library has nothing for it before generics and sorting-based helpers arrive. A small function here would save that copy-and-paste in every project.
Definition of done: `DedupeStrings(input []string) []string` returns a new slice containing each value once, in the order each value first appeared, with a doc comment and table-driven tests covering an empty slice, a nil slice, a slice with no repeats, a slice that is all the same value, and repeats that are not next to each other.
Model: opus-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Removing repeated values from a slice of strings while keeping the original order is something nearly every program ends up writing by hand, and the standard library has nothing for it before generics and sorting-based helpers arrive. A small function here would save that copy-and-paste in every project.
Definition of done:
DedupeStrings(input []string) []stringreturns a new slice containing each value once, in the order each value first appeared, with a doc comment and table-driven tests covering an empty slice, a nil slice, a slice with no repeats, a slice that is all the same value, and repeats that are not next to each other.Model: opus-5