Skip to content

Commit

Permalink
chore: no need for fmt.Sprintf
Browse files Browse the repository at this point in the history
  • Loading branch information
muesli committed Nov 1, 2022
1 parent ff5a27f commit afd9e71
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
6 changes: 1 addition & 5 deletions hyperlink.go
@@ -1,15 +1,11 @@
package termenv

import (
"fmt"
)

// Hyperlink creates a hyperlink using OSC8.
func Hyperlink(link, name string) string {
return output.Hyperlink(link, name)
}

// Hyperlink creates a hyperlink using OSC8.
func (o *Output) Hyperlink(link, name string) string {
return fmt.Sprintf(OSC+"8;;%s"+ST+"%s"+OSC+"8;;"+ST, link, name)
return OSC + "8;;" + link + ST + name + OSC + "8;;" + ST
}
4 changes: 1 addition & 3 deletions notification.go
@@ -1,13 +1,11 @@
package termenv

import "fmt"

// Notification triggers a notification using OSC777.
func Notification(title, body string) {
output.Notification(title, body)
}

// Notification triggers a notification using OSC777.
func (o *Output) Notification(title, body string) {
_, _ = o.WriteString(fmt.Sprintf(OSC+"777;notify;%s;%s"+ST, title, body))
_, _ = o.WriteString(OSC + "777;notify;" + title + ";" + body + ST)
}

0 comments on commit afd9e71

Please sign in to comment.