Skip to content

refactor: delete idl dependency and delete unused errors#685

Open
stdll00 wants to merge 2 commits intoktr0731:masterfrom
stdll00:refactor/delete-idl-package
Open

refactor: delete idl dependency and delete unused errors#685
stdll00 wants to merge 2 commits intoktr0731:masterfrom
stdll00:refactor/delete-idl-package

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
...
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

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.

1 participant