Skip to content
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

Replace Gin with http.ServeMux #5

Merged
merged 1 commit into from Oct 28, 2019
Merged

Replace Gin with http.ServeMux #5

merged 1 commit into from Oct 28, 2019

Conversation

@djui
Copy link
Contributor

djui commented Oct 28, 2019

An image speaks more than a thousands words.

Screenshot 2019-10-28 at 23 58 12

@djui djui self-assigned this Oct 28, 2019
@djui djui requested review from drPytho, K-Phoen and Zatte Oct 28, 2019
@Zatte

This comment has been minimized.

Copy link
Contributor

Zatte commented Oct 28, 2019

Sure does!
image

@Zatte

This comment has been minimized.

Copy link
Contributor

Zatte commented Oct 28, 2019

Amazing stuff :)

@djui

This comment has been minimized.

Copy link
Contributor Author

djui commented Oct 28, 2019

@Zatte See #6

ctx.JSON(http.StatusOK, gin.H{"status": "Still Alive!"})
s.Router.HandleFunc("/live", func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
_, _ = w.Write([]byte(`{"status": "Still Alive!"}`))

This comment has been minimized.

Copy link
@Zatte

Zatte Oct 28, 2019

Contributor

Such magic constant

This comment has been minimized.

Copy link
@djui

djui Oct 28, 2019

Author Contributor

It's all about heap allocations.

@@ -186,10 +166,15 @@ func WithHealthz() Option {
}
if len(errs) > 0 {
s.logger.Warn("Ready check failed", zap.Any("errs", errs))
c.JSON(http.StatusServiceUnavailable, gin.H{"errors": errs})
return
b, err := json.Marshal(map[string]interface{}{"errors": errs})

This comment has been minimized.

Copy link
@K-Phoen

K-Phoen Oct 28, 2019

Contributor

s.logger.Warn("Ready check failed", zap.Any("errs", errs))s.logger.Warn("Ready check failed", zap.Errors("errs", errs))?

This comment has been minimized.

Copy link
@djui

djui Oct 28, 2019

Author Contributor

Yes, but that will be my fourth PR ;-)

@djui djui force-pushed the remove-gin branch from 827dad1 to 46902e4 Oct 28, 2019
@djui djui merged commit 9b27be0 into master Oct 28, 2019
2 checks passed
2 checks passed
Tests
Details
GolangCI No issues found!
Details
@djui djui deleted the remove-gin branch Oct 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.