Source File
diff.go
Belonging Package
github.com/carapace-sh/carapace
package carapaceimport ()// Diff compares values of two actions.// It overrides the style to hightlight changes.//// red: only present in original// dim: present in both// green: only present in newfunc (, Action) Action {return ActionCallback(func( Context) Action {:= Batch(,,).Invoke():= make(map[string]common.RawValue)for , := range [0].action.rawValues {.Style = style.Red[.Value] =}for , := range [1].action.rawValues {if , := [.Value]; {.Style = style.Dim[.Value] =} else {.Style = style.Green[.Value] =}}:= .Merge().action.rawValues = make(common.RawValues, 0)for , := range {.action.rawValues = append(.action.rawValues, )}return .ToA()})}
![]() |
The pages are generated with Golds v0.8.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |