From 298f4b4634026f268ad74dadccbca8127ab83076 Mon Sep 17 00:00:00 2001 From: Rose Hogenson Date: Wed, 1 Oct 2025 03:09:25 -0700 Subject: Fix the n^2 using a linked list --- tools/notes/notes.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'tools') 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 } -- cgit v1.3.1