OSDN Git Service

libgo: Update to weekly.2012-01-15.
[pf3gnuchains/gcc-fork.git] / libgo / go / exp / sql / driver / types.go
index 086b529..d6ba641 100644 (file)
@@ -8,6 +8,7 @@ import (
        "fmt"
        "reflect"
        "strconv"
+       "time"
 )
 
 // ValueConverter is the interface providing the ConvertValue method.
@@ -39,7 +40,7 @@ type ValueConverter interface {
 //       1 is true
 //       0 is false,
 //       other integers are an error
-//  - for strings and []byte, same rules as strconv.Atob
+//  - for strings and []byte, same rules as strconv.ParseBool
 //  - all other types are an error
 var Bool boolType
 
@@ -143,9 +144,10 @@ func (stringType) ConvertValue(v interface{}) (interface{}, error) {
 //   bool
 //   nil
 //   []byte
+//   time.Time
 //   string
 //
-// This is the ame list as IsScanSubsetType, with the addition of
+// This is the same list as IsScanSubsetType, with the addition of
 // string.
 func IsParameterSubsetType(v interface{}) bool {
        if IsScanSubsetType(v) {
@@ -165,6 +167,7 @@ func IsParameterSubsetType(v interface{}) bool {
 //   bool
 //   nil
 //   []byte
+//   time.Time
 //
 // This is the same list as IsParameterSubsetType, without string.
 func IsScanSubsetType(v interface{}) bool {
@@ -172,7 +175,7 @@ func IsScanSubsetType(v interface{}) bool {
                return true
        }
        switch v.(type) {
-       case int64, float64, []byte, bool:
+       case int64, float64, []byte, bool, time.Time:
                return true
        }
        return false