Since generics were introduced maps.Keys() is now available to quickly get a slice of keys of a map (instead of having to iterate over the map and append to a slice). In 1.21, this function was moved from stdlib to golang.org/x/exp/maps. However, the test runners do not currently allow this library as an import.
Would it be possible to get the test runners to allow importing this library?
The test runner supports everything in that “exp” module already. @sbromberger It sounds like that is not working for you. Can you share the code you are trying to run and what (if any) error message you get?
The “Resistor Color” exercise fails on the runner with
resistor_color.go:3:8: no required module provides package golang.org/x/exp/maps; to add it:
go get golang.org/x/exp/maps
'/usr/local/go/bin/go test --short --json .' returned exit code 1: exit status 1
I tried resubmitting with go.mod and it failed complaining that there was no go.sum, so I submitted a third time with both go.mod and go.sum and the tests have been running now for ~3 minutes.
Edit: it’s still “processing” about 30 minutes later. I think the runner might be stuck.