gin-gonic / gin
Showing 1 of 2 files from the diff.
Other files ignored by Codecov
context_test.go has changed.

@@ -1161,22 +1161,28 @@
Loading
1161 1161
/***** GOLANG.ORG/X/NET/CONTEXT *****/
1162 1162
/************************************/
1163 1163
1164 -
// Deadline always returns that there is no deadline (ok==false),
1165 -
// maybe you want to use Request.Context().Deadline() instead.
1164 +
// Deadline returns that there is no deadline (ok==false) when c.Request has no Context.
1166 1165
func (c *Context) Deadline() (deadline time.Time, ok bool) {
1167 -
	return
1166 +
	if c.Request == nil || c.Request.Context() == nil {
1167 +
		return
1168 +
	}
1169 +
	return c.Request.Context().Deadline()
1168 1170
}
1169 1171
1170 -
// Done always returns nil (chan which will wait forever),
1171 -
// if you want to abort your work when the connection was closed
1172 -
// you should use Request.Context().Done() instead.
1172 +
// Done returns nil (chan which will wait forever) when c.Request has no Context.
1173 1173
func (c *Context) Done() <-chan struct{} {
1174 -
	return nil
1174 +
	if c.Request == nil || c.Request.Context() == nil {
1175 +
		return nil
1176 +
	}
1177 +
	return c.Request.Context().Done()
1175 1178
}
1176 1179
1177 -
// Err always returns nil, maybe you want to use Request.Context().Err() instead.
1180 +
// Err returns nil when c.Request has no Context.
1178 1181
func (c *Context) Err() error {
1179 -
	return nil
1182 +
	if c.Request == nil || c.Request.Context() == nil {
1183 +
		return nil
1184 +
	}
1185 +
	return c.Request.Context().Err()
1180 1186
}
1181 1187
1182 1188
// Value returns the value associated with this context for key, or nil
Files Coverage
binding 100.00%
render 92.96%
auth.go 100.00%
context.go 97.73%
debug.go 100.00%
deprecated.go 100.00%
errors.go 100.00%
fs.go 100.00%
gin.go 99.18%
logger.go 100.00%
mode.go 100.00%
path.go 100.00%
recovery.go 97.14%
response_writer.go 93.33%
routergroup.go 100.00%
test_helpers.go 100.00%
tree.go 100.00%
utils.go 96.83%
Project Totals (41 files) 98.71%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading