An unfortunate bug caused a number of packages in old x/tools versions
to fail to build with Go 1.25 (https://go.dev/issue/74462). Fix this
minimally by updating to the lowest patched version with the fix:
v0.24.1. This should allow wire to continue building with the same range
of Go versions as it could build with before (down to 1.19).
Also:
- Update the go.mod go directive to Go 1.19 to allow for module graph
pruning, and to be consistent with the minimum build version.
- Fix a test that is broken in recent Go versions due to an error
message change.
- Update tests to run on Go 1.25.x (the most recent version of Go).
- Remove coverage, since coverage upload wasn't working anyway.
Fixes#431
Change the go:generate command to use the full go run ... command
to ensure the version specified in the current go module is used
instead of the global binary.
Fixes#160
- Fixed a bug when a interface is bind to a value wire would fail to record it is used.
- Also rename ProvidedType.ConcreteType to Type since it doesn't necessarily returns a concrete type.
Fixes#72
Unfortunately, this does come with a ~4x slowdown to Wire, as it is
now pulling source for all transitively depended packages, but not
trimming comments or function bodies. This is due to limitations with
the ParseFile callback in go/packages.
This comes with a single semantic change: when performing analysis, Wire
will now evaluate everything with the wireinject build tag. I updated
the build tags tests accordingly. Prior to this PR, only the packages
directly named by the package patterns would be evaluated with the
wireinject build tag. Dependencies would not have the wireinject build
tag applied. There isn't a way to selectively apply build tags in go/packages,
and there isn't a clear benefit to applying it selectively. Being consistent with
other Go tooling provides greater benefit.
I deleted the vendoring test, as non-top-level vendoring
becomes obsolete with modules.
go/packages now parses comments by default, so now the generated code
includes comments for non-injector declarations.
Fixesgoogle/go-cloud#78
The primary motivation is to permit a move to using go/packages instead
of go/loader. go/packages runs exclusively by shelling out to the go
tool, which precludes use of the in-memory "magic" GOPATH being used
up to this point.
This has a secondary effect of removing a lot of code to support "magic"
GOPATH from the test infrastructure. This is on the whole good, but
necessitated a change in the error scrubbing: since the filenames are
no longer fixed, error scrubbing also must remove the leading
$GOPATH/src lines.
Another related change: since all callers of Generate needed to know the
package path in order to write out wire_gen.go (necessitating a
find-only import search) and Generate already has this information,
Generate now returns this information to the caller. This should further
reduce callers' coupling to Wire's load internals. It also eliminates
code duplication.
This should hopefully shake out any difference in path separators for
running on Windows, but I have not tested that yet.
Updates google/go-cloud#78
Updates google/go-cloud#323
Update Provider.Out to be a slice of provided types, and keep track
of the provided concrete type in ProviderSet.providerMap, to more
clearly model-named struct providers (which provide both the struct
type and a pointer to the struct type).
Fixesgoogle/go-cloud#325.