This example is based on command line tool
Installing all dependency files are managed by dep package manager
go get -u github.com/golang/dep/cmd/dep
dep ensureExample I have written uses a server client communication using tcp
Client invoke server's service to get result.
In this example Server does 2 function
- Square
- Return square of number
- default number is 1
- Cube
- Return cube of number
- default number is 1
go run client/main.go -square 122 -cube 9
2018/04/26 15:10:54 Square of 122: 14884
2018/04/26 15:10:54 Cube of 9: 729For this to work we need to run first run server and client.
go run server/main.gogo run client/main.go