Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Writing temp file to os temp dir
Browse files Browse the repository at this point in the history
linzhp committed Aug 25, 2022
1 parent 0f231a2 commit a0342d7
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions stringer.go
Original file line number Diff line number Diff line change
@@ -18,7 +18,6 @@ import (
"go/importer"
"go/token"
"go/types"
"io/ioutil"
"log"
"os"
"path/filepath"
@@ -149,7 +148,7 @@ func main() {
}

// Write to tmpfile first
tmpFile, err := ioutil.TempFile(dir, fmt.Sprintf("%s_enumer_", typs[0]))
tmpFile, err := os.CreateTemp("", fmt.Sprintf("%s_enumer_", typs[0]))
if err != nil {
log.Fatalf("creating temporary file for output: %s", err)
}

0 comments on commit a0342d7

Please sign in to comment.