mirror of
https://github.com/hanzoai/expr.git
synced 2026-09-24 16:58:58 +00:00
Go 1.21+ rejects 'replace X => Y vN' when Y's go.mod declares a module
path other than Y. The prior v1.17.8 kept 'module github.com/expr-lang/expr'
while being hosted+required at github.com/hanzoai/expr, so consumers on
Go 1.26 fail with:
module declares its path as: github.com/expr-lang/expr
but was required as: github.com/hanzoai/expr
Rehome the declared module path to github.com/hanzoai/expr and repath all
internal imports to match. Consumers keep 'require github.com/expr-lang/expr'
and 'replace github.com/expr-lang/expr => github.com/hanzoai/expr vX' — the
standard renaming-fork pattern that Go's replace path-check accepts.
23 lines
406 B
Go
23 lines
406 B
Go
package vm_test
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
|
|
"github.com/hanzoai/expr/vm"
|
|
)
|
|
|
|
func TestProgram_Disassemble(t *testing.T) {
|
|
for op := vm.OpPush; op < vm.OpEnd; op++ {
|
|
program := vm.Program{
|
|
Constants: []any{1, 2},
|
|
Bytecode: []vm.Opcode{op},
|
|
Arguments: []int{1},
|
|
}
|
|
d := program.Disassemble()
|
|
if strings.Contains(d, "(unknown)") {
|
|
t.Errorf("cannot disassemble all opcodes")
|
|
}
|
|
}
|
|
}
|