Skip to content

Commit

Permalink
Merge pull request #11 from GreyXor/deprecated-tempfile
Browse files Browse the repository at this point in the history
Replace deprecated tempfile with createtemp
  • Loading branch information
samcoe authored Oct 6, 2023
2 parents 1dd80dd + 7b54e0a commit b393df5
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 b393df5

Please sign in to comment.