Skip to content
Snippets Groups Projects
Commit 88a7459f authored by Nick Thomas's avatar Nick Thomas
Browse files

Remove two unused structs

parent 4d4ea305
No related branches found
No related tags found
1 merge request!1Initial implementation of an elasticsearch indexer in Go
Loading
Loading
@@ -23,28 +23,3 @@ func ReadConfig(r io.Reader) (*Config, error) {
 
return &out, nil
}
type ReaderAsJSONString struct {
io.Reader
}
func (r *ReaderAsJSONString) MarshalJSON() ([]byte, error) {
/* TODO: fewer copies
out := bytes.NewBuffer(nil)
err := out.WriteByte('"')
_, err = io.Copy(out, r.Reader) // FIXME: convert to valid JSON string data, escape quote marks
err = out.WriteByte('"')
return out.Bytes(), err
*/
data, err := ioutil.ReadAll(r.Reader)
if err != nil {
return nil, err
}
return json.Marshal(string(data))
}
type Req struct {
Blob *ReaderAsJSONString `json:"blob"`
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment