Fix issues identified by go vet

batch-wip
Jack Christensen 2017-05-06 19:48:03 -05:00
parent c78d450c19
commit 6a2a5e28fd
2 changed files with 5 additions and 5 deletions

View File

@ -118,26 +118,26 @@ func (dst *Interval) DecodeText(ci *ConnInfo, src []byte) error {
hours, err := strconv.ParseInt(timeParts[0], 10, 64) hours, err := strconv.ParseInt(timeParts[0], 10, 64)
if err != nil { if err != nil {
return fmt.Errorf("bad interval hour format: %s", hours) return fmt.Errorf("bad interval hour format: %s", timeParts[0])
} }
minutes, err := strconv.ParseInt(timeParts[1], 10, 64) minutes, err := strconv.ParseInt(timeParts[1], 10, 64)
if err != nil { if err != nil {
return fmt.Errorf("bad interval minute format: %s", minutes) return fmt.Errorf("bad interval minute format: %s", timeParts[1])
} }
secondParts := strings.SplitN(timeParts[2], ".", 2) secondParts := strings.SplitN(timeParts[2], ".", 2)
seconds, err := strconv.ParseInt(secondParts[0], 10, 64) seconds, err := strconv.ParseInt(secondParts[0], 10, 64)
if err != nil { if err != nil {
return fmt.Errorf("bad interval second format: %s", seconds) return fmt.Errorf("bad interval second format: %s", secondParts[0])
} }
var uSeconds int64 var uSeconds int64
if len(secondParts) == 2 { if len(secondParts) == 2 {
uSeconds, err = strconv.ParseInt(secondParts[1], 10, 64) uSeconds, err = strconv.ParseInt(secondParts[1], 10, 64)
if err != nil { if err != nil {
return fmt.Errorf("bad interval decimal format: %s", seconds) return fmt.Errorf("bad interval decimal format: %s", secondParts[1])
} }
for i := 0; i < 6-len(secondParts[1]); i++ { for i := 0; i < 6-len(secondParts[1]); i++ {

View File

@ -676,7 +676,7 @@ func TestConnBeginTxReadOnly(t *testing.T) {
var pgReadOnly string var pgReadOnly string
err = tx.QueryRow("show transaction_read_only").Scan(&pgReadOnly) err = tx.QueryRow("show transaction_read_only").Scan(&pgReadOnly)
if err != nil { if err != nil {
t.Errorf("%d. QueryRow failed: %v", err) t.Errorf("QueryRow failed: %v", err)
} }
if pgReadOnly != "on" { if pgReadOnly != "on" {