当前位置:网站首页>2022-07-30:以下go语言代码输出什么?A:[]byte{} []byte;B:[]byte{} []uint8;C:[]uint8{} []byte;D:[]uin8{} []uint8。
2022-07-30:以下go语言代码输出什么?A:[]byte{} []byte;B:[]byte{} []uint8;C:[]uint8{} []byte;D:[]uin8{} []uint8。
2022-07-31 05:03:00 【福大大架构师每日一题】
2022-07-30:以下go语言代码输出什么?A:[]byte{} []byte;B:[]byte{} []uint8;C:[]uint8{} []byte;D:[]uin8{} []uint8。
package main
import "fmt"
func main() {
x := []byte{
}
fmt.Printf("%#v %T\n", x, x)
}
答案2022-07-30:
答案选 B。这是一个 bug,说正确答案应该是 []uint8{} []uint8 才对,因为 byte 是 uint8 的别名,但现在即使是 x := []uint8{},结果也还是 B。不过为了兼容性,该 bug 目前不会修复,影响不大,详见:https://github.com/golang/go/issues/44391。
另一道有争议的题,arp和rarp属于数据链路层还是网络层?有人说是网络层,也有人说是数据链路层。我个人倾向于数据链路层。
边栏推荐
- 工作流编排引擎-Temporal
- [R language] [3] apply, tapply, lapply, sapply, mapply and par function related parameters
- Interview | Cheng Li, CTO of Alibaba: Cloud + open source together form a credible foundation for the digital world
- SQL语句中对时间字段进行区间查询
- 30 Years of Open Source Community | 2022 Open Atom Global Open Source Summit 30 Years of Open Source Community Special Event Held Successfully
- Error EPERM operation not permitted, mkdir 'Dsoftwarenodejsnode_cache_cacach Two solutions
- 【线性神经网络】softmax回归
- Minesweeper game - C language
- 限流的原理
- MySQL optimization slow log query
猜你喜欢
Two address pools r2 are responsible for managing the address pool r1 is responsible for managing dhcp relays
sql statement - how to query data in another table based on the data in one table
12个MySQL慢查询的原因分析
Unity Framework Design Series: How Unity Designs Network Frameworks
CentOS7 install MySQL graphic detailed tutorial
The Vue project connects to the MySQL database through node and implements addition, deletion, modification and query operations
MySQL开窗函数
ES source code API call link source code analysis
Industry-university-research application to build an open source talent ecosystem | 2022 Open Atom Global Open Source Summit Education Sub-Forum was successfully held
HCIP第十天_BGP路由汇总实验
随机推荐
prompt.ml/15中<svg>标签使用解释
Unity Tutorial: URP Rendering Pipeline Practical Tutorial Series [1]
Apache DButils使用注意事项--with modifiers “public“
A complete introduction to JSqlParse of Sql parsing and conversion
【debug锦集】Expected input batch_size (1) to match target batch_size (0)
.NET-6.WinForm2.NanUI学习和总结
Temporal客户端模型
扫雷小游戏——C语言
城市内涝及桥洞隧道积水在线监测系统
Create componentized development based on ILRuntime hot update
MySQL forgot password
CentOS7 安装MySQL 图文详细教程
[Detailed explanation of ORACLE Explain]
1. Get data - requests.get()
mysql uses on duplicate key update to update data in batches
1. 获取数据-requests.get()
The input input box displays the precision of two decimal places
SQL语句中对时间字段进行区间查询
三道leetcode上的oj题
.NET-9. A mess of theoretical notes (concepts, ideas)