Skip to content
This repository was archived by the owner on Aug 25, 2025. It is now read-only.
This repository was archived by the owner on Aug 25, 2025. It is now read-only.

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

Description

@anthonyfok

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions