2. try fixing grpc plugin failed to get issue
use v4.0.0-v4.0.0-00010101000000-000000000000 instead of specific version
3. kafka panic on disconnect
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x18 pc=0x1266c50]
goroutine 31 [running]:
github.com/asim/go-micro/plugins/broker/kafka/v3.(*kBroker).Disconnect(0xc0002400c0)
C:/Workshop/Go/pkg/mod/github.com/asim/go-micro/plugins/broker/kafka/v3@v3.7.0/kafka.go:130 +0xd0
github.com/asim/go-micro/plugins/server/grpc/v3.(*grpcServer).Start.func2()
C:/Workshop/Go/pkg/mod/github.com/asim/go-micro/plugins/server/grpc/v3@v3.0.0-20210712061837-0532fd9de8ae/grpc.go:998 +0xc8d
created by github.com/asim/go-micro/plugins/server/grpc/v3.(*grpcServer).Start
C:/Workshop/Go/pkg/mod/github.com/asim/go-micro/plugins/server/grpc/v3@v3.0.0-20210712061837-0532fd9de8ae/grpc.go:917 +0xcaf
exit status 2
I realized that when writing `require go-micro.dev/v4 v4.1.0` in the
`go.mod` file, `go mod tidy` will install that exact version of
`go-micro.dev/v4`. As of right now, v4.1.0 is an outdated version, and
preferably we shouldn't be updating gomu's Go Modules template everytime
a new release is tagged, but still want gomu users to generate projects
using the latest Go Micro version.
In an attempt to solve this problem, I'm opting to add a new Makefile
rule for new projects generated by gomu, `update` that runs `go get -u`.
This aggressively updates any dependencies your Go Modules project may
have. `go mod tidy` is then able to prune the `go.mod` and `go.sum`
files by removing the unnecessary checksums and transitive dependencies
(e.g. `// indirect`), that were added to by go get -u due to newer
semver available.
Put one and one together and you get two. In addition to adding an
`update` rule to the Makefile generated for new projects by gomu, I'm
also updating the proto and client comments printed when new projects
have been generated to promote the `update` rule.
References:
- https://stackoverflow.com/questions/67201708/go-update-all-modules
go get: installing executables with 'go get' in module mode is deprecated.
To adjust and download dependencies of the current module, use 'go get -d'.
To install using requirements of the current module, use 'go install'.
To install ignoring the current module, use 'go install' with a version,
like 'go install example.com/cmd@latest'.
For more information, see https://golang.org/doc/go-get-install-deprecation
or run 'go help get' or 'go help install'.
* add errors.As
convert target err to *Error, return false if err don't match *Error
* update errors.As to (*Error, bool)
* fixing FromError panic issue when err is nil
Though some of the Zap logger option can be customized through
plugins/logger/zap.Options, this change allows go.uber.org/zap.Option be
be injected directly for deeper customization.