summaryrefslogtreecommitdiffstats
path: root/tools/notes
diff options
context:
space:
mode:
Diffstat (limited to 'tools/notes')
-rw-r--r--tools/notes/notes.go9
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/notes/notes.go b/tools/notes/notes.go
index 2b03694..f22b7f9 100644
--- a/tools/notes/notes.go
+++ b/tools/notes/notes.go
@@ -211,19 +211,18 @@ func (*newCommand) SetFlags(*flag.FlagSet) {}
type createNoteRequestStreamWriter struct {
ctx context.Context
continuationToken []byte
- name string
}
func (w *createNoteRequestStreamWriter) Write(buf []byte) (int, error) {
resp, err := createNote(w.ctx, &api.CreateNoteRequest{
ContinuationToken: w.continuationToken,
Chunk: buf,
+ More: true,
})
if err != nil {
return 0, err
}
w.continuationToken = resp.ContinuationToken
- w.name = resp.Name
return len(buf), nil
}
@@ -237,7 +236,11 @@ func (*newCommand) new(ctx context.Context, fileName string) error {
if _, err := io.Copy(streamWriter, f); err != nil {
return err
}
- fmt.Println(streamWriter.name)
+ resp, err := createNote(ctx, &api.CreateNoteRequest{ContinuationToken: streamWriter.continuationToken})
+ if err != nil {
+ return err
+ }
+ fmt.Println(resp.Name)
return nil
}