333}
334
335func (r *resourceType) ClearVersions() (int64, error) {
336 results, err := psql.Delete("resource_config_versions").337 Where(sq.Eq{
338 "resource_config_scope_id": r.resourceConfigScopeID,
339 }).
485}
486
487func (r *resource) ClearVersions() (int64, error) {
488 results, err := psql.Delete("resource_config_versions"). 489 Where(sq.Eq{
490 "resource_config_scope_id": r.resourceConfigScopeID,
491 }).
222 if exeNotFound && someShell {
223 spec.Path = "sh"
224 os.Stderr.WriteString("\rCouldn't find \"bash\" on container, retrying with \"sh\"\n\r")
225 result, exeNotFound, err = h.Hijack(ctx, team.Name(), chosenContainer.ID, spec, io)226 }
227 return result, err
228 }()
332 ts := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
333 fmt.Fprintln(w, "Hello, client")
334 }))
335 l, err := net.Listen("tcp", hostIp.String()+":0") 336 ts.Listener = l
337 ts.Start()
338 defer ts.Close()
423 ts := httptest.NewUnstartedServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
424 fmt.Fprintln(w, "Hello, client")
425 }))
426 l, err := net.Listen("tcp", hostIp.String()+":0") 427 ts.Listener = l
428 ts.Start()
429 defer ts.Close()
Value has been assigned to a variable, but it is being overwritten before being read. In most cases, this could be a forgotten error check or dead code.
err := Op1()
// error value assigned to "err" by "Op1" is replaced with
// error value assigned by "Op2" before even being read even
// once
err = Op2()
if err != nil {
return err
}
// Ignore the error value returned by "Op1"
Op1()
err := Op2()
if err != nil {
return err
}
err := Op1()
// Read the error value assigned to "err" by "Op1"
if err != nil {
return err
}
err = Op2()
if err != nil {
return err
}