Standard library / go/types
go/types.NewTerm()
Creates a union term; tilde means types with the specified underlying type. Expected stdout: '~int\n'.
Formal Syntax & Structure
go syntaxgo
func NewTerm(tilde bool, typ Type) *TermParameters & Attributes
| Name | Type | Description |
|---|---|---|
| tilde | bool | Input to the operation as described above. |
| typ | Type | Type associated with the object or value. |
Return Value
*Term
Creates a union term; tilde means types with the specified underlying type.
Working Example
Example Snippetgo
package main
import ( "fmt" "go/types")
func term() *types.Term { return types.NewTerm(true, types.Typ[types.Int]) }
func main() { fmt.Println(term()) }