Download pkg/slicesx/normalize.go from Leon4gr45/openmeter: direct link, hf CLI and curl.
- Browser
- Download file 166 Bytes
-
https://huggingface.co/spaces/Leon4gr45/openmeter/resolve/main/pkg/slicesx/normalize.go
- Command line
-
hf download hf://spaces/Leon4gr45/openmeter/pkg/slicesx/normalize.go
-
curl -L -o normalize.go https://huggingface.co/spaces/Leon4gr45/openmeter/resolve/main/pkg/slicesx/normalize.go
166 Bytes
| package slicesx | |
| import ( | |
| "cmp" | |
| "slices" | |
| ) | |
| func Normalize[S ~[]E, E cmp.Ordered](s S) S { | |
| out := slices.Clone(s) | |
| slices.Sort(out) | |
| return slices.Compact(out) | |
| } | |