Re-wrote from scratch in Golang

- Re-implemented the project in Golang, and deprecated Python entirely
- Implemented several new, long-requested features
- Refactored cheatsheets into a separate repository
This commit is contained in:
Chris Lane
2019-10-20 10:02:28 -04:00
parent 307c4e6ad6
commit e5114a3e76
271 changed files with 2630 additions and 7834 deletions

View File

@@ -0,0 +1,23 @@
package sheets
import (
"github.com/cheat/cheat/internal/sheet"
)
// Consolidate applies cheatsheet "overrides", resolving title conflicts that
// exist among cheatpaths by preferring more local cheatsheets over less local
// cheatsheets.
func Consolidate(
cheatpaths []map[string]sheet.Sheet,
) map[string]sheet.Sheet {
consolidated := make(map[string]sheet.Sheet)
for _, cheatpath := range cheatpaths {
for title, sheet := range cheatpath {
consolidated[title] = sheet
}
}
return consolidated
}