golang.org/x/build@v0.0.0-20240506185731-218518f32b70/perfdata/db/export_test.go (about) 1 // Copyright 2017 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 db 6 7 import ( 8 "database/sql" 9 "time" 10 ) 11 12 func DBSQL(db *DB) *sql.DB { 13 return db.sql 14 } 15 16 func SetNow(t time.Time) { 17 if t.IsZero() { 18 now = time.Now 19 return 20 } 21 now = func() time.Time { return t } 22 }