Please sign in to comment.
Fix other Go Report Card warnings (#423)
Fix other warnings that we might run into on Go Report Card. * go vet: fix warnings about unkeyed field initialization Add field names to struct initializers, mostly these are our private key structs. * go ineffassign: fix ineffective assignments This is a neat tool that mostly catches unhandled errors (assignments to err variables that are never read). Add appropriate error handling to deal with these warnings. Pay attention to the subtle difference between = and := assignments. * go cyclo: reduce cyclomatic complexity Some functions already had it too high, some got it too high after additional error handling. We can't do anything about it other than split the big functions into smaller ones and introduce helpers to avoid too many conditionals in a single function. * go misspell: fix a couple of typos * go fmt: reformat the code * Improve error handling in Themis server examples - Split the code in Secure Message example in the same way we do for Secure Session. - Improve the quit message a but. Without quotes it's not intuitive that you have to literally type in q-u-i-t to quit cleanly. - Unify error reporting in the code and output messages to stderr. - Exit with non-zero status code to indicate failure. - Make sure that errors are printed out nicely.
- Loading branch information...
Showing with 186 additions and 81 deletions.
- +55 −14 docs/examples/Themis-server/go/smessage_server.go
- +72 −18 docs/examples/Themis-server/go/ssession_server.go
- +2 −2 docs/examples/go/secure_message.go
- +1 −1 docs/examples/go/secure_session_client.go
- +1 −1 docs/examples/go/secure_session_server.go
- +14 −10 gothemis/cell/cell.go
- +14 −10 gothemis/cell/cell_test.go
- +2 −2 gothemis/compare/compare.go
- +8 −6 gothemis/message/message_test.go
- +5 −5 gothemis/session/session.go
- +12 −12 gothemis/session/session_test.go
Oops, something went wrong.