fix: divergence from std go and minimal args check (#361)
This commit is contained in:
parent
82b543fd98
commit
2a24e1e1c6
1 changed files with 8 additions and 2 deletions
|
@ -50,12 +50,18 @@ func fmtPrintf(args ...tengo.Object) (ret tengo.Object, err error) {
|
|||
}
|
||||
|
||||
func fmtPrintln(args ...tengo.Object) (ret tengo.Object, err error) {
|
||||
numArgs := len(args)
|
||||
if numArgs == 0 {
|
||||
return nil, tengo.ErrWrongNumArguments
|
||||
}
|
||||
|
||||
printArgs, err := getPrintArgs(args...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
printArgs = append(printArgs, "\n")
|
||||
_, _ = fmt.Print(printArgs...)
|
||||
|
||||
fmt.Println(printArgs...)
|
||||
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue