g/a/toposort: add topological sorting pkg
This adds a package which implements topological sorting.
There are existing Go packages out there which do this, but all of
them have various shortcomings, either in the API or in
performance or stability.
This uses a fairly simple DFS-based algorithm for doing the majority
of the work. It uses generics for the nodes to allow for flexibility and
is covered by a fuzz test to check for correctness.
Change-Id: I4ae3f0b97ef801350b87cdae3a3d9a1ba63830e3
Reviewed-on: https://review.monogon.dev/c/monogon/+/1351
Tested-by: Jenkins CI
Reviewed-by: Serge Bazanski <serge@monogon.tech>
diff --git a/build/analysis/nogo_config.json b/build/analysis/nogo_config.json
index da28532..21afc4d 100644
--- a/build/analysis/nogo_config.json
+++ b/build/analysis/nogo_config.json
@@ -2,7 +2,8 @@
"composites": {
"exclude_files": {
"external/": "third_party",
- "metropolis/pkg/bootparam/": "gofuzz"
+ "metropolis/pkg/bootparam/": "gofuzz",
+ "go/algorithm/toposort/": "gofuzz"
}
},
"copylocks": {