3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-02-22 08:17:37 +00:00

Fix variable naming: tmpFile -> tempFile for Go conventions

Co-authored-by: NikolajBjorner <3085284+NikolajBjorner@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-02-16 21:48:51 +00:00 committed by Nikolaj Bjorner
parent f734ce9ce3
commit b0702bfa0f
2 changed files with 5 additions and 6 deletions

View file

@ -5,4 +5,3 @@ go 1.20
require github.com/Z3Prover/z3/src/api/go v0.0.0 require github.com/Z3Prover/z3/src/api/go v0.0.0
replace github.com/Z3Prover/z3/src/api/go => ../../src/api/go replace github.com/Z3Prover/z3/src/api/go => ../../src/api/go

View file

@ -53,7 +53,7 @@ func main() {
fmt.Println("\nExample 3: FromFile() - Load SMT-LIB2 from file") fmt.Println("\nExample 3: FromFile() - Load SMT-LIB2 from file")
// Create a temporary SMT-LIB2 file // Create a temporary SMT-LIB2 file
tmpFile, err := os.CreateTemp("", "test-*.smt2") tempFile, err := os.CreateTemp("", "test-*.smt2")
if err != nil { if err != nil {
fmt.Println("Error creating temp file:", err) fmt.Println("Error creating temp file:", err)
} else { } else {
@ -62,14 +62,14 @@ func main() {
(assert (or p q)) (assert (or p q))
(assert (or (not p) (not q)))` (assert (or (not p) (not q)))`
_, err = tmpFile.WriteString(content) _, err = tempFile.WriteString(content)
tmpFile.Close() tempFile.Close()
if err != nil { if err != nil {
fmt.Println("Error writing temp file:", err) fmt.Println("Error writing temp file:", err)
} else { } else {
solver3 := ctx.NewSolver() solver3 := ctx.NewSolver()
solver3.FromFile(tmpFile.Name()) solver3.FromFile(tempFile.Name())
fmt.Println("Loaded SMT-LIB2 assertions from file") fmt.Println("Loaded SMT-LIB2 assertions from file")
status3 := solver3.Check() status3 := solver3.Check()
@ -78,7 +78,7 @@ func main() {
fmt.Println("Found satisfying assignment") fmt.Println("Found satisfying assignment")
} }
} }
os.Remove(tmpFile.Name()) // Clean up os.Remove(tempFile.Name()) // Clean up
} }
// Example 4: Parameter configuration // Example 4: Parameter configuration