You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
interface{} and unsafe.Pointer give some freedom to type system in Go but sometimes, some may want to limit the number of types interface{} or unsafe.Pointer can be declared or converted to at compile time, with //go: unsafe_typestrict and //go: interface_typestrict can solve it. This pragma can work on variables and function parameters. example: //go: interface_typestrict <variable / parameter name> <accepted types>
interface{}
andunsafe.Pointer
give some freedom to type system in Go but sometimes, some may want to limit the number of typesinterface{}
orunsafe.Pointer
can be declared or converted to at compile time, with//go: unsafe_typestrict
and//go: interface_typestrict
can solve it. This pragma can work on variables and function parameters. example://go: interface_typestrict <variable / parameter name> <accepted types>
unsafe:
//go:unsafe_typestrict < var / param name> <accepted types>
these directives can also work on function parameters
These can also allow underhand types like how it is when using Generics
The text was updated successfully, but these errors were encountered: