EL
Size: a a a
EL
SP
ВС
SP
K
package main
import (
"fmt"
)
type GG struct {
S string
}
func (g *GG) String() string {
return g.S+"228"
}
func (g *GG) Error() string {
return g.S
}
func main() {
g := &GG{
S: "228asd",
}
fmt.Printf("%s\n%v\n", g, g)
}
x
4. If an operand implements the error interface, the Error method will be invoked to convert the object to a string, which will then be formatted as required by the verb (if any).
DP
K
4. If an operand implements the error interface, the Error method will be invoked to convert the object to a string, which will then be formatted as required by the verb (if any).
C
C
GC
GC
SP
ВС