Skip to content

Commit

Permalink
Minor code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
kenshaw committed Jun 11, 2024
1 parent aae9a37 commit d8c7902
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -1005,17 +1005,17 @@ func (h *Handler) Version(ctx context.Context) error {
}

// Print formats according to a format specifier and writes to handler's standard output.
func (h *Handler) Print(format string, a ...interface{}) {
func (h *Handler) Print(s string, v ...interface{}) {
if env.Get("QUIET") == "on" {
return
}
fmt.Fprintln(h.l.Stdout(), fmt.Sprintf(format, a...))
fmt.Fprintln(h.l.Stdout(), fmt.Sprintf(s, v...))
}

// doExecWatch repeatedly executes a query against the database.
func (h *Handler) doExecWatch(ctx context.Context, w io.Writer, opt metacmd.Option, prefix, sqlstr string, qtyp bool, bind []interface{}) error {
for {
// this is the actual output that psql has: "Mon Jan 2006 3:04:05 PM MST"
// the actual output that psql has: "Mon Jan 2006 3:04:05 PM MST" -- which is _slightly_ different than RFC1123
// fmt.Fprintf(w, "%s (every %fs)\n\n", time.Now().Format("Mon Jan 2006 3:04:05 PM MST"), float64(opt.Watch)/float64(time.Second))
fmt.Fprintf(w, "%s (every %v)\n", time.Now().Format(time.RFC1123), opt.Watch)
fmt.Fprintln(w)
Expand Down

0 comments on commit d8c7902

Please sign in to comment.