Standard library / reflect

reflect.Value.CanAddr()

Report whether Addr may be called; addressability alone does not permit mutation. Expected stdout: 'false\n'.

Formal Syntax & Structure

go syntaxgo
func (v Value) CanAddr() bool

Return Value

bool

Report whether Addr may be called; addressability alone does not permit mutation.

Working Example

Example Snippetgo
package main
import (  "fmt"  "reflect")
func main() { fmt.Println(reflect.ValueOf(42).CanAddr()) }
Go Reference