Skip to content

Commit

Permalink
replace deprecated tempfile with createtemp
Browse files Browse the repository at this point in the history
  • Loading branch information
GreyXor committed Oct 6, 2023
1 parent 1dd80dd commit 7b54e0a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions browser.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ package browser
import (
"fmt"
"io"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
Expand All @@ -30,7 +29,7 @@ func OpenFile(path string) error {
// OpenReader consumes the contents of r and presents the
// results in a new browser window.
func OpenReader(r io.Reader) error {
f, err := ioutil.TempFile("", "browser.*.html")
f, err := os.CreateTemp("", "browser.*.html")
if err != nil {
return fmt.Errorf("browser: could not create temporary file: %w", err)
}
Expand Down

0 comments on commit 7b54e0a

Please sign in to comment.