Make graph.Delta zero state invalid for use
Previously, an incorrectly initialised Delta (omission of Action) would result in an Add operation. Make that detectable and return an error.
This commit is contained in:
parent
9088fe376b
commit
46f987ca51
5 changed files with 20 additions and 5 deletions
|
|
@ -28,12 +28,12 @@ import (
|
|||
"github.com/google/cayley/quad"
|
||||
)
|
||||
|
||||
type Procedure byte
|
||||
type Procedure int8
|
||||
|
||||
// The different types of actions a transaction can do.
|
||||
const (
|
||||
Add Procedure = iota
|
||||
Delete
|
||||
Add Procedure = +1
|
||||
Delete Procedure = -1
|
||||
)
|
||||
|
||||
type Delta struct {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue