Skip to content

Commit

Permalink
add "default" returns in hopes of getting older go (1.0.2) to compile.
Browse files Browse the repository at this point in the history
No guarantees.
  • Loading branch information
mattbaird committed Apr 14, 2014
1 parent 99b8b36 commit 7e48d22
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
6 changes: 2 additions & 4 deletions core/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,8 @@ func Exists(index string, _type string, id string, args map[string]interface{})
}
if httpStatusCode == http.StatusOK {
return true, err
} else {
return false, err
}
return false, err
}

// ExistsIndex allows caller to check for the existance of an index or a type using HEAD
Expand All @@ -111,7 +110,6 @@ func ExistsIndex(index string, _type string, args map[string]interface{}) (bool,
}
if httpStatusCode == http.StatusOK {
return true, err
} else {
return false, err
}
return false, err
}
22 changes: 10 additions & 12 deletions core/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,13 @@ func UpdateWithPartialDoc(index string, _type string, id string, args map[string
}
content := fmt.Sprintf("{\"doc\":%s %s}", v, upsertStr)
return Update(index, _type, id, args, content)
default:
var data map[string]interface{} = make(map[string]interface{})
data["doc"] = doc
if upsert {
data["doc_as_upsert"] = true
}
return Update(index, _type, id, args, data)
}
var data map[string]interface{} = make(map[string]interface{})
data["doc"] = doc
if upsert {
data["doc_as_upsert"] = true
}
return Update(index, _type, id, args, data)
}

// UpdateWithScript updates a document based on a script provided.
Expand All @@ -88,10 +87,9 @@ func UpdateWithScript(index string, _type string, id string, args map[string]int
paramsPart := fmt.Sprintf("{\"params\":%s}", v)
data := fmt.Sprintf("{\"script\":\"%s\", \"params\":%s}", script, paramsPart)
return Update(index, _type, id, args, data)
default:
var data map[string]interface{} = make(map[string]interface{})
data["params"] = params
data["script"] = script
return Update(index, _type, id, args, data)
}
var data map[string]interface{} = make(map[string]interface{})
data["params"] = params
data["script"] = script
return Update(index, _type, id, args, data)
}

0 comments on commit 7e48d22

Please sign in to comment.