Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TestWire/Interface{Value,Binding}NotEnoughArgs fail with Go 1.18 #355

Open
anthonyfok opened this issue Apr 6, 2022 · 0 comments · May be fixed by #356
Open

TestWire/Interface{Value,Binding}NotEnoughArgs fail with Go 1.18 #355

anthonyfok opened this issue Apr 6, 2022 · 0 comments · May be fixed by #356

Comments

@anthonyfok
Copy link

Describe the bug

TestWire/InterfaceValueNotEnoughArgs and TestWire/InterfaceBindingNotEnoughArgs pass with Go 1.17 but fail with Go 1.18.

To Reproduce

Steps to reproduce the behavior.

$ go version
go version go1.18 linux/amd64
$ go test ./...
?   	github.com/google/wire	[no test files]
?   	github.com/google/wire/cmd/wire	[no test files]
--- FAIL: TestWire (0.01s)
    --- FAIL: TestWire/InterfaceValueNotEnoughArgs (1.99s)
        wire_test.go:108: /tmp/wire_test1036055382/src/example.com/foo/wire.go:25:38: not enough arguments in call to wire.InterfaceValue
            	have (string)
            	want (interface{}, interface{})
        wire_test.go:121: Errors didn't match expected errors from wire_errors.txt:
            {[]string}[0]:
            	-: "example.com/foo/wire.go:x:y: not enough arguments in call to wire.InterfaceValue\n\thave (string)\n\twant (interface{}, interface{})"
            	+: "example.com/foo/wire.go:x:y: not enough arguments in call to wire.InterfaceValue"
    --- FAIL: TestWire/InterfaceBindingNotEnoughArgs (2.35s)
        wire_test.go:108: /tmp/wire_test3298095484/src/example.com/foo/wire.go:25:33: not enough arguments in call to wire.Bind
            	have (*Fooer)
            	want (interface{}, interface{})
        wire_test.go:121: Errors didn't match expected errors from wire_errors.txt:
            {[]string}[0]:
            	-: "example.com/foo/wire.go:x:y: not enough arguments in call to wire.Bind\n\thave (*Fooer)\n\twant (interface{}, interface{})"
            	+: "example.com/foo/wire.go:x:y: not enough arguments in call to wire.Bind"
FAIL
FAIL	github.com/google/wire/internal/wire	50.802s
FAIL

Expected behavior

The tests should pass.

Version

v0.5.0-12-g9d78e0a (tip of main branch)

Additional context

FTBFS (Fail to build from source) when Debian upgraded from golang-1.17 to golang-1.18 as the default Go version.
See https://bugs.debian.org/1008413 (Thanks to @lnussbaum for the bug report)

Many thanks!

anthonyfok added a commit to anthonyfok/wire that referenced this issue Apr 12, 2022
This fixes error message mismatch in InterfaceBindingNotEnoughArgs
and InterfaceValueNotEnoughArgs with Go 1.18.

The Go version in tests.yml GitHub workflow is updated accordingly.

Fixes google#355
@anthonyfok anthonyfok linked a pull request Apr 12, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant