case idl.ErrPackageUnselected:case idl.ErrUnknownServiceName: are unreachable.
Errors in idl package such as ErrPackageUnselected are duplicated with usecase package and it seems seems unused except unreachale case.
Behavior changes
Error message changed when specify service without selecting package or speficy invalid service name.
Prepare
cp repl/testdata/test.proto repl/testdata/test2.proto
sed -i -e 's/package api;/package api2;/g' repl/testdata/test2.proto # set different package name
On master branch
$ go run main.go --proto repl/testdata/test.proto
...
127.0.0.1:50051> service hoge
command service: unknown service name
$ go run main.go --proto repl/testdata/test.proto --proto repl/testdata/test2.proto
...
127.0.0.1:50051> service api.Example
command service: package unselected
On this branch,
$ go run main.go --proto repl/testdata/test.proto
...
api.Example@127.0.0.1:50051> service hoge
command service: unknown service name 'hoge'
$ go run main.go --proto repl/testdata/test.proto --proto repl/testdata/test2.proto
...
127.0.0.1:50051> service api.Example
command service: package unselected. please execute 'package' command at the first
Fix these issues:
case idl.ErrPackageUnselected:
case idl.ErrUnknownServiceName:
are unreachable.ErrPackageUnselected
are duplicated withusecase
package and it seems seems unused except unreachale case.Behavior changes
Error message changed when specify service without selecting package or speficy invalid service name.
Prepare
On master branch
On this branch,