This is a creation in Article, where the information may have evolved or changed.
When assigning a value to an interface in a/*go language, if the object is a value (not handled by the recipient of the reference), the value can be handled automatically if it is a pointer */package mainimport "FMT"//Defines the integer type integer inttype Lessaddinf interface{less (n integer) booladd (n integer) integer}func (this integer) less (n integers) Bool{return this < N}func (This *integer) ADD (n Integer) integer{*this + = Nreturn *this}type computer struct{cpu string "Calculator" Memory string "inside Save "}type Thing Interface{name () Stringattribute () String}func (this computer) Name () string {return ' computer '}func (this *computer) Attribute () string {return FMT. Sprintf ("Cpu=%v memory=%v", this. CPU, this. Memory)}func Main () {var inf lessaddinfvar n integerinf = &nfmt. Printf ("INF. Less (=%v\n) ", INF. Less (+)) fmt. Printf ("INF. ADD (+) =%v\n ", INF. ADD ()) var thing thingvar computer = computer{cpu: "Intel Xeon-v3440", Memory: "Samsung DDR4 (8g)"}thing = &computerfmt. Printf ("thing. Name () =%v\n ", thing. Name ()) fmt. Printf ("thing. Attribute () =%v\n ", thing. Attribute ())}