Standard library / go/types

go/types.Var.Embedded()

Reports whether a field is embedded. Expected stdout: 'true\n'.

Formal Syntax & Structure

go syntaxgo
func (obj *Var) Embedded() bool

Return Value

bool

Reports whether a field is embedded.

Working Example

Example Snippetgo
package main
import (  "fmt"  "go/types")
func main() { v := types.NewField(0, nil, "T", types.Typ[types.Int], true); fmt.Println(v.Embedded()) }
Go Reference