diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2021-08-31 19:54:25 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2021-08-31 19:54:25 -0600 |
commit | 43a997529328c0ebbe50b79ccb6ad830abbcd983 (patch) | |
tree | 627df846ff98581ace3b6ad7f96cc428854d5680 /cmd.go | |
parent | fa806f39c831c75d7dbfa3ac406eb2d14fe04cd3 (diff) |
Fix that failing testfix
Diffstat (limited to 'cmd.go')
-rw-r--r-- | cmd.go | 15 |
1 files changed, 12 insertions, 3 deletions
@@ -33,6 +33,11 @@ package libfastimport type fiReader interface { PeekLine() (string, error) ReadLine() (string, error) + SetCommandMark(int) +} + +type fiReaderState interface { + GetCommandMark() int } type fiWriter interface { @@ -54,9 +59,13 @@ const ( type Cmd interface { fiCmdRead(fiReader) (Cmd, error) fiCmdWrite(fiWriter) error - fiCmdClass() cmdClass + fiCmdClass(fiReaderState) cmdClass } -func cmdIs(cmd Cmd, class cmdClass) bool { - return cmd.fiCmdClass()&class != 0 +type noopReaderState struct{} + +func (_ noopReaderState) GetCommandMark() int { return 0 } + +func cmdIs(state fiReaderState, cmd Cmd, class cmdClass) bool { + return cmd.fiCmdClass(state)&class != 0 } |