#1674·yaegi

min/max functions are undefined

Author: lboyntonCreated Dec 19, 2024Updated May 4, 2026
Labelsbugarea/core

The following program sample.go triggers an unexpected result

go
package main

import "fmt"

func main() {
	fmt.Println(max(1, 2))
}

Expected result

bash
$ go run ./sample.go
2

Got

bash
$ yaegi ./sample.go
run: sample.go:6:14: undefined: max

Yaegi Version

v0.16.1

Additional Notes

These functions should be part of Go 1.21: https://go.dev/ref/spec#Min_and_max