updated go report card issues

This commit is contained in:
Derek McQuay 2017-03-14 20:13:36 -07:00
parent b87a297986
commit a4d885e01d
No known key found for this signature in database
GPG Key ID: 92A7BC0C86B0B91A
3 changed files with 9 additions and 7 deletions

View File

@ -9,9 +9,11 @@ import (
) )
func main() { func main() {
d := &kvrepl.DB{PKV: true} d := &kvrepl.DB{
d.KV1 = make(map[string]string) KV1: map[string]string{},
d.KV2 = make(map[string]string) KV2: map[string]string{},
PKV: true,
}
scanner := bufio.NewScanner(os.Stdin) scanner := bufio.NewScanner(os.Stdin)
for scanner.Scan() { for scanner.Scan() {
v, err := kvrepl.Parse(scanner.Text(), d) v, err := kvrepl.Parse(scanner.Text(), d)

View File

@ -81,7 +81,7 @@ func TestSeries(t *testing.T) {
"failed series:\n\tfailed to write", "failed series:\n\tfailed to write",
) )
} }
v, err := read([]string{"a"}, kv) v, _ := read([]string{"a"}, kv)
if v != "b" { if v != "b" {
t.Errorf( t.Errorf(
"failed series:\n\texpected: %v\n\t actual: %v", "failed series:\n\texpected: %v\n\t actual: %v",
@ -89,8 +89,8 @@ func TestSeries(t *testing.T) {
v, v,
) )
} }
err = del([]string{"a"}, kv) _ = del([]string{"a"}, kv)
v, err = read([]string{"a"}, kv) v, _ = read([]string{"a"}, kv)
if v != "" { if v != "" {
t.Errorf( t.Errorf(
"failed series:\n\texpected: %v\n\t actual: %v", "failed series:\n\texpected: %v\n\t actual: %v",

View File

@ -7,7 +7,7 @@ import (
) )
// Parse decides what commands to run and returns a string containing the // Parse decides what commands to run and returns a string containing the
// value of a read or an error if one occured. // value of a read or an error if one occurred.
func Parse(s string, d *DB) (string, error) { func Parse(s string, d *DB) (string, error) {
args := strings.Split(s, " ") args := strings.Split(s, " ")