Skip to content

Commit e1cf7db

Browse files
committed
rows: compile time interface implementation checks
1 parent 32d1a5f commit e1cf7db

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

rows_test.go

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Go MySQL Driver - A MySQL-Driver for Go's database/sql package
2+
//
3+
// Copyright 2017 The Go-MySQL-Driver Authors. All rights reserved.
4+
//
5+
// This Source Code Form is subject to the terms of the Mozilla Public
6+
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
7+
// You can obtain one at http://mozilla.org/MPL/2.0/.
8+
9+
package mysql
10+
11+
import (
12+
"database/sql/driver"
13+
)
14+
15+
// Ensure that all the driver interfaces are implemented
16+
var (
17+
_ driver.Rows = &binaryRows{}
18+
_ driver.Rows = &textRows{}
19+
_ driver.RowsColumnTypeDatabaseTypeName = &binaryRows{}
20+
_ driver.RowsColumnTypeDatabaseTypeName = &textRows{}
21+
_ driver.RowsColumnTypeNullable = &binaryRows{}
22+
_ driver.RowsColumnTypeNullable = &textRows{}
23+
_ driver.RowsColumnTypeScanType = &binaryRows{}
24+
_ driver.RowsColumnTypeScanType = &textRows{}
25+
_ driver.RowsNextResultSet = &binaryRows{}
26+
_ driver.RowsNextResultSet = &textRows{}
27+
)

0 commit comments

Comments
 (0)