Skip to content
This repository was archived by the owner on Jul 23, 2025. It is now read-only.

chore: bunch of small refactors for improved devex#124

Merged
samlaf merged 7 commits intomainfrom
samlaf--devex-improvements
Sep 18, 2024
Merged

chore: bunch of small refactors for improved devex#124
samlaf merged 7 commits intomainfrom
samlaf--devex-improvements

Conversation

@samlaf
Copy link
Copy Markdown
Contributor

@samlaf samlaf commented Sep 17, 2024

See commit names for summary of changes.

Copy link
Copy Markdown
Contributor

@ethenotethan ethenotethan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - just a slew of knits but nothing blocking 😄

server/server.go Outdated
if err != nil {
svr.log.Info("failed to decode commitment", "err", err, "key", key)
w.WriteHeader(http.StatusBadRequest)
err = fmt.Errorf("failed to decode commitment from key %v (commitment mode %v): %w", key, ct, err)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

knit - the commitment mode string could be isolated into a single for reference across error strings

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wdym by "into a single"?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging this to unblock other work, but ping me to let me know what you meant and we can create another PR

server/server.go Outdated
@@ -159,25 +155,26 @@ func (svr *Server) Health(w http.ResponseWriter, _ *http.Request) error {
func (svr *Server) HandleGet(w http.ResponseWriter, r *http.Request) error {
ct, err := ReadCommitmentMode(r)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

knit and irrelevant to PR - ct implies CommitmentType but it should probably shorthand notation cm

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +19 to +21
var Version = "unknown"
var Commit = "unknown"
var Date = "unknown"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

knit - could encapsulate under a single var declaration

Copy link
Copy Markdown
Contributor Author

@samlaf samlaf Sep 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@samlaf samlaf force-pushed the samlaf--devex-improvements branch from 0d05a6d to 2473f8e Compare September 18, 2024 05:19
@samlaf samlaf requested a review from ethenotethan September 18, 2024 17:39
@samlaf samlaf force-pushed the samlaf--devex-improvements branch from 624c815 to 405de62 Compare September 18, 2024 22:10
@samlaf samlaf merged commit 3325042 into main Sep 18, 2024
@samlaf samlaf deleted the samlaf--devex-improvements branch September 18, 2024 22:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants