Skip to content

Commit

Permalink
oops, codeRabbit called me out on sloppiness
Browse files Browse the repository at this point in the history
  • Loading branch information
sm3142 committed Nov 13, 2024
1 parent 1c5a71d commit a130837
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion humacli/humacli.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ func (c *cli[O]) setupOptions(t reflect.Type, path []int) {
if !field.IsExported() {
// This isn't a public field, so we cannot use reflect.Value.Set with
// it. This is usually a struct field with a lowercase name.
fmt.Println("warning: ignoring unexported options field", field.Name)
fmt.Fprintln(os.Stderr, "warning: ignoring unexported options field", field.Name)
continue
}

Expand Down
7 changes: 4 additions & 3 deletions sse/sse.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"encoding/json"
"fmt"
"net/http"
"os"
"reflect"
"runtime/debug"
"time"
Expand Down Expand Up @@ -160,10 +161,10 @@ func Register[I any](api huma.API, op huma.Operation, eventTypeMap map[string]an
send := func(msg Message) error {
if deadliner != nil {
if err := deadliner.SetWriteDeadline(time.Now().Add(WriteTimeout)); err != nil {
fmt.Println("warning: unable to set write deadline: " + err.Error())
fmt.Fprintln(os.Stderr, "warning: unable to set write deadline: "+err.Error())
}
} else {
fmt.Println("warning: unable to set write deadline")
fmt.Fprintln(os.Stderr, "warning: unable to set write deadline")
}

// Write optional fields
Expand Down Expand Up @@ -198,7 +199,7 @@ func Register[I any](api huma.API, op huma.Operation, eventTypeMap map[string]an
if flusher != nil {
flusher.Flush()
} else {
fmt.Println("error: unable to flush")
fmt.Fprintln(os.Stderr, "error: unable to flush")
return fmt.Errorf("unable to flush: %w", http.ErrNotSupported)
}
return nil
Expand Down

0 comments on commit a130837

Please sign in to comment.