-
-
Notifications
You must be signed in to change notification settings - Fork 432
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
Open for some refactor? #286
Comments
Hey! I love the enthusiasm! I'm definitely open for refactoring and making things easier for the community to help maintain/contribute. I'll need to dive into the test piece more for sure. Is there a reason you removed error logging and references to the local logging package? I think the current format returns early when errors are encountered just by the nature of the collapsed |
Cool, I'll make sure my draft is complete and will open it up for reviews then!
You can see it described here in the Uber golang style guide
So, inline error checks definitely has it place! We could instead declare the variable and assign them with var newKey string
var err error
if newKey, err = mythicCrypto.GenerateKeysForPayload("aes256_hmac"){
return nil, fmt.Errorf("failed to generate new AES key for staging rsa: %v", err)
} You can see an example in the Uber style guide here If the function, only returns something that doesn't need to be used later on ( |
Sorry it's taking me so long to get around to this! I kept meaning to merge them in, but then would get side tracked with other tasks. As I've been adding new features, I've been trying to keep the principals you described in mind though. I merged in two of your PRs so far |
No worries, thanks for merging them! |
Hey,
I was looking at the project a bit and was wondering if you were open for some refactoring of the code-base (before I commit to much time on it if you don't want to).
These code changes would follow the generic Go guidance available here, or earlier, simpler here
At a first glance this could includes updates such as:
Some higher level refactoring could be further discussed at a later point (e.g: creating a shared go.mod to ensure cross compatibility between binaries, simpler code sharing, folder restructure to match a more "Go idiomatic" way)
I believe this would help maintenance on the long term and people on boarding the project on a shorter term.
Example PR: #285
The text was updated successfully, but these errors were encountered: