From c007ce824d9a4fccb148f9204e04c23ed2984b71 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Mon, 8 Sep 2014 00:08:51 -0400 Subject: build: move package sources from src/pkg to src Preparation was in CL 134570043. This CL contains only the effect of 'hg mv src/pkg/* src'. For more about the move, see golang.org/s/go14nopkg. --- src/pkg/database/sql/example_test.go | 46 ------------------------------------ 1 file changed, 46 deletions(-) delete mode 100644 src/pkg/database/sql/example_test.go (limited to 'src/pkg/database/sql/example_test.go') diff --git a/src/pkg/database/sql/example_test.go b/src/pkg/database/sql/example_test.go deleted file mode 100644 index dcb74e0699..0000000000 --- a/src/pkg/database/sql/example_test.go +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright 2013 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package sql_test - -import ( - "database/sql" - "fmt" - "log" -) - -var db *sql.DB - -func ExampleDB_Query() { - age := 27 - rows, err := db.Query("SELECT name FROM users WHERE age=?", age) - if err != nil { - log.Fatal(err) - } - defer rows.Close() - for rows.Next() { - var name string - if err := rows.Scan(&name); err != nil { - log.Fatal(err) - } - fmt.Printf("%s is %d\n", name, age) - } - if err := rows.Err(); err != nil { - log.Fatal(err) - } -} - -func ExampleDB_QueryRow() { - id := 123 - var username string - err := db.QueryRow("SELECT username FROM users WHERE id=?", id).Scan(&username) - switch { - case err == sql.ErrNoRows: - log.Printf("No user with that ID.") - case err != nil: - log.Fatal(err) - default: - fmt.Printf("Username is %s\n", username) - } -} -- cgit v1.3