diff options
| author | Shulhan <ms@kilabit.info> | 2023-09-10 21:27:22 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2023-09-11 02:16:52 +0700 |
| commit | 310ca99dd0b47e15428089028546fcfa1e0e02e7 (patch) | |
| tree | 1aa5ec46b562e8f183937347bc6252fbe9a48185 /lib/http/endpoint_response_example_test.go | |
| parent | df58e21e4a8fa4fa308ec1b791867968972f57f3 (diff) | |
| download | pakakeh.go-310ca99dd0b47e15428089028546fcfa1e0e02e7.tar.xz | |
lib/http: realign struct for better size allocation
The realignment reduce the cost of the following struct,
* EndpointResponse: from 72 to 56 bytes (-16 bytes)
* RangePosition: from 48 to 24 bytes (-24 bytes)
* testCase in TestParseContentRange: from 24 to 16 bytes (-8 bytes)
Diffstat (limited to 'lib/http/endpoint_response_example_test.go')
| -rw-r--r-- | lib/http/endpoint_response_example_test.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/http/endpoint_response_example_test.go b/lib/http/endpoint_response_example_test.go index 91829346..de34a11e 100644 --- a/lib/http/endpoint_response_example_test.go +++ b/lib/http/endpoint_response_example_test.go @@ -98,7 +98,7 @@ func ExampleEndpointResponse() { fmt.Printf("GET /?id=1000 => %s\n", resBody) // Output: - // GET / => {"code":400,"message":"empty parameter id"} - // GET /?id=0 => {"code":500,"message":"id value 0 cause internal server error"} - // GET /?id=1000 => {"code":200,"data":{"ID":"1000"}} + // GET / => {"message":"empty parameter id","code":400} + // GET /?id=0 => {"message":"id value 0 cause internal server error","code":500} + // GET /?id=1000 => {"data":{"ID":"1000"},"code":200} } |
