Standard library / go/types

go/types.NewInterface()

Legacy constructor accepting embedded named types. Prefer NewInterfaceType. Expected stdout: 'true\n'.

Formal Syntax & Structure

go syntaxgo
func NewInterface(methods []*Func, embeddeds []*Named) *Interface

Parameters & Attributes

NameTypeDescription
methods[]*FuncMethod objects to attach.
embeddeds[]*NamedInput to the operation as described above.

Return Value

*Interface

Legacy constructor accepting embedded named types.

Working Example

Example Snippetgo
package main
import (  "fmt"  "go/types")
func main() { i := types.NewInterface(nil, nil).Complete(); fmt.Println(i.Empty()) }
Go Reference