-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcfgbugs.go
More file actions
45 lines (36 loc) · 813 Bytes
/
cfgbugs.go
File metadata and controls
45 lines (36 loc) · 813 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package veracity
import (
"fmt"
"slices"
"github.com/urfave/cli/v2"
)
var (
// recovers timestamp_committed from merklelog_entry.commit.idtimestamp prior to hashing
Bug9308 = "9308"
Bugs = []string{
Bug9308,
}
)
func IsSupportedBug(id string) bool {
return slices.Contains(Bugs, id)
}
func Bug(cmd *CmdCtx, id string) bool {
if cmd.bugs == nil {
return false
}
return cmd.bugs[id]
}
// cfgBugs checks the requested bug workarounds are valid and populates the map
// of enabled workarounds.
func cfgBugs(cmd *CmdCtx, cCtx *cli.Context) error {
cmd.bugs = map[string]bool{}
// just one supported atm
id := cCtx.String("bug")
if id != "" {
if !IsSupportedBug(id) {
return fmt.Errorf("bug: %s no supported work around or accommodation", id)
}
cmd.bugs[id] = true
}
return nil
}