Source file src/database/sql/internal/sql.go

     1  // Copyright 2026 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // Package internal contains internal symbols shared between
     6  // database/sql and database/sql/driver.
     7  package internal
     8  
     9  // ScanContext is database/sql/driver.ScanContext.
    10  // We define it here so driver.ScanContext can be opaque to users but
    11  // visible to database/sql.
    12  type ScanContext struct {
    13  	v any
    14  }
    15  
    16  func NewScanContext(v any) ScanContext {
    17  	return ScanContext{v}
    18  }
    19  
    20  func ScanContextValue(c ScanContext) any {
    21  	return c.v
    22  }
    23  

View as plain text