fmt.Println(outFile.Name())代码在异常处理代码之前,当出现异常的时候,下方的异常处理代码无法执行。 建议将其移至 if err != nil { fmt.Println(err) return } 下方