周刊维护在:https://github.com/eryajf/learning-weekly (opens new window) 欢迎投稿,推荐或自荐项目 /文章 /博客,请提交 issue 。
周刊核心为运维周刊,还会侧重Go语言生态,Vue相关技术生态的项目,以及 GitHub 上优秀项目或经验。
你也可以在我的博客 https://wiki.eryajf.net/learning-weekly/ (opens new window) 查看汇总周刊。
🔥 有不少人想单独从博客通过 RSS 订阅周刊的更新,现在它来了,你可以使用这个🔗 链接 (opens new window)进行订阅。


## ToString
cast.ToString("mayonegg") // "mayonegg"
cast.ToString(8) // "8"
cast.ToString(8.31) // "8.31"
cast.ToString([]byte("one time")) // "one time"
cast.ToString(nil) // ""
var foo interface{} = "one more time"
cast.ToString(foo) // "one more time"
## ToInt
cast.ToInt(8) // 8
cast.ToInt(8.31) // 8
cast.ToInt("8") // 8
cast.ToInt(true) // 1
cast.ToInt(false) // 0
var eight interface{} = 8
cast.ToInt(eight) // 8
cast.ToInt(nil) // 0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

申明
原创文章eryajf,未经授权,严禁转载,侵权必究!此乃文中随机水印,敬请读者谅解。
周刊维护在:https://github.com/eryajf/learning-weekly (opens new window) 欢迎投稿,推荐或自荐项目 /文章 /博客,请提交 issue 。
周刊核心为运维周刊,还会侧重Go语言生态,Vue相关技术生态的项目,以及 GitHub 上优秀项目或经验。
你也可以在我的博客 https://wiki.eryajf.net/learning-weekly/ (opens new window) 查看汇总周刊。
🔥 有不少人想单独从博客通过 RSS 订阅周刊的更新,现在它来了,你可以使用这个🔗 链接 (opens new window)进行订阅。


## ToString
cast.ToString("mayonegg") // "mayonegg"
cast.ToString(8) // "8"
cast.ToString(8.31) // "8.31"
cast.ToString([]byte("one time")) // "one time"
cast.ToString(nil) // ""
var foo interface{} = "one more time"
cast.ToString(foo) // "one more time"
## ToInt
cast.ToInt(8) // 8
cast.ToInt(8.31) // 8
cast.ToInt("8") // 8
cast.ToInt(true) // 1
cast.ToInt(false) // 0
var eight interface{} = 8
cast.ToInt(eight) // 8
cast.ToInt(nil) // 0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

申明
原创文章eryajf,未经授权,严禁转载,侵权必究!此乃文中随机水印,敬请读者谅解。