diff --git a/db.go b/db.go index 459c0d5..a0e64f5 100644 --- a/db.go +++ b/db.go @@ -91,7 +91,7 @@ func (dbs *dbSession) PrepareForUpdate(columns []string) (*time.Time, error) { return nil, err } - t, err := timeFromDBFormat(lastSeenTimeStr) + t, _ := timeFromDBFormat(lastSeenTimeStr) lastSeemTime = &t } @@ -154,7 +154,7 @@ func (dbs *dbSession) QueryTop(spec *RequestCountSpec) ([]string, [][]string, er } strValues := make([]string, len(values)) for i, value := range values { - strValues[i] = fmt.Sprintf("%s", *value.(*sql.RawBytes)) + strValues[i] = string(*value.(*sql.RawBytes)) } results = append(results, strValues) } diff --git a/main.go b/main.go index d55c4a1..771e80b 100644 --- a/main.go +++ b/main.go @@ -115,10 +115,8 @@ func resolveWhereConditions(clauses []string) (map[string][]string, error) { } if column, found := FIELD_NAMES[keyvalue[0]]; !found { return nil, fmt.Errorf("unknown field name %s", keyvalue[0]) - } else if _, found := conditions[column]; found { - conditions[column] = append(conditions[column], keyvalue[1]) } else { - conditions[column] = []string{keyvalue[1]} + conditions[column] = append(conditions[column], keyvalue[1]) } }