Standard library / reflect

reflect.Value.Comparable()

Report whether equality comparisons of this value are safe, including the dynamic type of interface values. Expected stdout: 'false\n'.

Formal Syntax & Structure

go syntaxgo
func (v Value) Comparable() bool

Return Value

bool

Report whether equality comparisons of this value are safe, including the dynamic type of interface values.

Working Example

Example Snippetgo
package main
import (  "fmt"  "reflect")
func main() { fmt.Println(reflect.ValueOf([]int{1}).Comparable()) }
Go Reference