Skip to content

Commit

Permalink
examples: Clean up typed server a little
Browse files Browse the repository at this point in the history
  • Loading branch information
bep committed Aug 12, 2022
1 parent fa2ac98 commit d46c3aa
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ Client/Gob-10 227 ± 0%

## Status Codes

The status codes in the header between 1 and 100 are reserved for the system. This will typically be used to catch decoding/encoding errors on the server.
The status codes in the header between 1 and 99 are reserved for the system. This will typically be used to catch decoding/encoding errors on the server.
7 changes: 1 addition & 6 deletions examples/servers/typed/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,7 @@ func main() {
fmt.Println("Printing outside server before")
}

var (
server *execrpc.Server[model.ExampleRequest, model.ExampleResponse]
err error
)

server, err = execrpc.NewServer(
server, err := execrpc.NewServer(
execrpc.ServerOptions[model.ExampleRequest, model.ExampleResponse]{
Codec: codec,
Call: func(d execrpc.Dispatcher, req model.ExampleRequest) model.ExampleResponse {
Expand Down
2 changes: 1 addition & 1 deletion server.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const (
MessageStatusErrEncodeFailed

// MessageStatusSystemReservedMax is the maximum value for a system reserved status code.
MessageStatusSystemReservedMax = 100
MessageStatusSystemReservedMax = 99
)

// NewServerRaw creates a new Server. using the given options.
Expand Down

0 comments on commit d46c3aa

Please sign in to comment.