当前位置:网站首页>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属于数据链路层还是网络层?有人说是网络层,也有人说是数据链路层。我个人倾向于数据链路层。
边栏推荐
- STM32HAL库修改Hal_Delay为us级延时
- DVWA安装教程(懂你的不懂·详细)
- MySQL database addition, deletion, modification and query (detailed explanation of basic operation commands)
- ES 源码 API调用链路源码分析
- 1. 获取数据-requests.get()
- centos7安装mysql5.7
- Temporal客户端模型
- ES source code API call link source code analysis
- Minesweeper game (written in c language)
- Unity URP渲染管线摄像机核心机制剖析
猜你喜欢
MySQL忘记密码怎么办
Simple read operation of EasyExcel
mysql uses on duplicate key update to update data in batches
Summary of MySQL common interview questions (recommended collection!!!)
MySQL window function
Minesweeper game (written in c language)
DVWA installation tutorial (understand what you don't understand · in detail)
【wpf】wpf中的那些模板之深度解析
Numpy中np.meshgrid的简单用法示例
input输入框展示两位小数之precision
随机推荐
MySQL事务隔离级别详解
MySQL开窗函数
ERP生产作业控制 金蝶
Unity resources management series: Unity framework how to resource management
.NET-6.WinForm2.NanUI learning and summary
STM32HAL library modifies Hal_Delay to us-level delay
The Vue project connects to the MySQL database through node and implements addition, deletion, modification and query operations
矩池云快速安装torch-sparse、torch-geometric等包
STM32 - DMA
WPF WPF 】 【 the depth resolution of the template
ERROR 2003 (HY000) Can't connect to MySQL server on 'localhost3306' (10061)
简易网络文件拷贝的C实现
ERROR 1064 (42000) You have an error in your SQL syntax; check the manual that corresponds to your
Unity Tutorial: URP Rendering Pipeline Practical Tutorial Series [1]
三道leetcode上的oj题
On Governance and Innovation | 2022 OpenAtom Global Open Source Summit OpenAnolis sub-forum was successfully held
SQL语句中对时间字段进行区间查询
[Linear Neural Network] softmax regression
.NET-6.WinForm2.NanUI学习和总结
Summary of MySQL common interview questions (recommended collection!!!)