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

refactor: delete idl dependency and delete unused errors #685

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

stdll00
Copy link

@stdll00 stdll00 commented Nov 26, 2023

Fix these issues:

  • 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
...
[email protected]: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

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 this pull request may close these issues.

None yet

1 participant