Check if the context is expired.

 

    // Check if the context is expired.
    select {
    default:
    case <-ctx.Done():
        db.mu.Unlock()
        return nil, ctx.Err()
    }

 

Go\src\database\sql\sql.go

posted @ 2022-09-08 18:00  papering  阅读(53)  评论(0编辑  收藏  举报