Open abck opened 2 years ago
@d5 will you accept such patch?
This is the current code:
func fmtPrintln(args ...tengo.Object) (ret tengo.Object, err error) {
printArgs, err := getPrintArgs(args...)
if err != nil {
return nil, err
}
printArgs = append(printArgs, "\n")
_, _ = fmt.Print(printArgs...)
return nil, nil
}
Honestly, I don't remember why I specifically used fmt.Print
. It's been a while. @geseq any ideas?
Tbh I can’t recall either but looking at the code the only reason I can think of is to avoid printing spaces between the operands.
that said, I would be happy for this to behave like standard library.
Hello,
just want to ask if the behavior of stdlib.fmt.println is correct.
I was expecting it to behave like the go's fmt.Println.
Minimal example:
Output:
1st line is the output of tengo's fmt.println 2nd line is the output of go's fmt.Println
If this is not intended, it can be fixed by changing fmtPrintln in stdlib/fmt.go to