Using type approximation

Report a typo

Suppose you have a Go program that has the Float set of constraints, it permits only floating-point types:

type Float interface {
    float32 | float64
}

Your program also has custom-defined types area and volume:

type area float32
type volume float64

Select below the correct syntax that the Float set of constraints should have to allow area and volume as valid type arguments for generic functions.

Select one option from the list
___

Create a free account to access the full topic