WebGo v4.1.3 Release Notes

Release Date: 2020-07-14 // almost 4 years ago
  • [minor] added webgo.ResponseStatus(rw http.ResponseWriter) int which returns response status code
    🛠 [patch] fixed a bug which did not send appropriate JSON response header for the convenience methods
    🖨 [patch] fixed accesslog middleware not printing valid http status code when not using webgo response methods
    0️⃣ [patch] fixed regression introduced in 4.0.4, where default http status was 0, now it's set to 200
    🔨 [patch] refactored accesslog & CORS middleware (moved to new package)
    🔨 [patch] refactored global logger for improved modularity
    🚚 [patch] Removed unnecessary WriteHeader from SendResponse, SendError. Added relevant header write for Send
    [-] added handler which directly writes using w.Write where 'w' is the http.ResponseWriter, in cmd/main.go
    ✅ [-] added tests for logger
    🐎 [-] no performance impact with these changes
    🚚 [-] removed the empty deprecation logs function
    🚚 [-] removed unwanted comments from cmd/main.go
    ⚡️ [-] updated README with correct version number & updated important section highlight the regression
    ⚡️ [-] updated README with correct version number and updated the sample code
    ⚡️ [-] updated tests to test if w.Write([]byte) where 'w' is the http.ResponseWriter, works as expected

Previous changes from v4.0.4

  • [patch] added http.CloseNotifier implementation
    🔨 [patch] refactored response writer and context payload usage
    🚚 [patch] removed ineffectual assignments
    🚚 [patch] removed redundant check of customResponseWriter.headerWritten
    ✏️ [-] fixed typos in comments
    🔨 [-] refactored for better readability at multiple places

    [-] MacBook Pro (13-inch, 2019, Two Thunderbolt 3 ports), OS: 10.15.5 (19F101), Go 1.14.4 darwin/amd64
    [-] benchmark results

            BenchmarkGetNoParams-8 809166 1433 ns/op
            BenchmarkGetWithParams-8 229358 4878 ns/op
            BenchmarkPostWithParams-8 204218 4904 ns/op