mirror of
https://github.com/unknwon/the-way-to-go_ZH_CN.git
synced 2025-08-12 02:35:53 +08:00
fix 10.6.9 wrong
cannot use i (type *Integer) as type int in argument to strconv.Itoa
This commit is contained in:
@@ -648,7 +648,7 @@ Go 不需要一个显式的类定义,如同 Java、C++、C# 等那样,相反
|
|||||||
```go
|
```go
|
||||||
type Integer int
|
type Integer int
|
||||||
func (i *Integer) String() string {
|
func (i *Integer) String() string {
|
||||||
return strconv.Itoa(i)
|
return strconv.Itoa(int(*i))
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user