dedupKey returns a deterministic key identifying a hook by (type, command, args).
(h Hook)
| 300 | |
| 301 | // dedupKey returns a deterministic key identifying a hook by (type, command, args). |
| 302 | func dedupKey(h Hook) string { |
| 303 | var b strings.Builder |
| 304 | b.WriteString(h.Type) |
| 305 | b.WriteByte(0) |
| 306 | b.WriteString(h.Command) |
| 307 | for _, a := range h.Args { |
| 308 | b.WriteByte(0) |
| 309 | b.WriteString(a) |
| 310 | } |
| 311 | return b.String() |
| 312 | } |
| 313 | |
| 314 | // hookResult is the outcome of a single hook invocation: the raw |
| 315 | // [HandlerResult] reported by the handler plus a post-execution err |