MCPcopy Index your code
hub / github.com/coder/coder / latestBuildOptional

Function latestBuildOptional

coderd/httpmw/workspaceagent.go:37–40  ·  view source on GitHub ↗
(r *http.Request)

Source from the content-addressed store, hash-verified

35type latestBuildContextKey struct{}
36
37func latestBuildOptional(r *http.Request) (database.WorkspaceBuild, bool) {
38 wb, ok := r.Context().Value(latestBuildContextKey{}).(database.WorkspaceBuild)
39 return wb, ok
40}
41
42// LatestBuild returns the Latest Build from the ExtractLatestBuild handler.
43func LatestBuild(r *http.Request) database.WorkspaceBuild {

Callers 1

LatestBuildFunction · 0.85

Calls 2

ContextMethod · 0.65
ValueMethod · 0.45

Tested by

no test coverage detected