From 40649971ccc3930312db360532416103ba8e501f Mon Sep 17 00:00:00 2001 From: TimLai666 <43640816+TimLai666@users.noreply.github.com> Date: Thu, 17 Oct 2024 11:04:06 +0800 Subject: [PATCH] Update lpgen.go --- lpgen/lpgen.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lpgen/lpgen.go b/lpgen/lpgen.go index db49b77..0260408 100644 --- a/lpgen/lpgen.go +++ b/lpgen/lpgen.go @@ -118,7 +118,11 @@ func (lp *LPModel) GenerateLPFile(filename string) { // 添加整數變數 if len(lp.IntegerVars) > 0 { - file.WriteString("General\n") + _, err = file.WriteString("General\n") + if err != nil { + insyra.LogWarning("lpgen.GenerateLPFile: Failed to write general: %v, returning", err) + return + } for _, intVar := range lp.IntegerVars { _, err = file.WriteString(" " + intVar + "\n") if err != nil {