当前位置:网站首页>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属于数据链路层还是网络层?有人说是网络层,也有人说是数据链路层。我个人倾向于数据链路层。
边栏推荐
- Three oj questions on leetcode
- 12个MySQL慢查询的原因分析
- View source and switch mirrors in two ways: npm and nrm
- 【R语言】【3】apply,tapply,lapply,sapply,mapply与par函数相关参数
- MySQL database installation (detailed)
- visual studio 那些提高效率的快捷键,总结(不时更新)
- Lua,ILRuntime, HybridCLR(wolong)/huatuo hot update comparative analysis
- Minio上传文件ssl证书不受信任
- Go language study notes - dealing with timeout problems - Context usage | Go language from scratch
- STM32HAL库修改Hal_Delay为us级延时
猜你喜欢

聚变云原生,赋能新里程 | 2022开放原子全球开源峰会云原生分论坛圆满召开

MySQL forgot password

On Governance and Innovation | 2022 OpenAtom Global Open Source Summit OpenAnolis sub-forum was successfully held

Centos7 install mysql5.7 steps (graphical version)

Lua,ILRuntime, HybridCLR(wolong)/huatuo热更新对比分析

CentOS7 —— yum安装mysql

Temporal介绍

From scratch, a mirror to the end, a pure system builds a grasscutter (Grasscutter)

信息系统项目管理师核心考点(五十五)配置管理员(CMO)的工作

110道 MySQL面试题及答案 (持续更新)
随机推荐
DVWA靶场环境搭建
从零开始,一镜到底,纯净系统搭建除草机(Grasscutter)
XSS靶场(三)prompt to win
On-line monitoring system for urban waterlogging and water accumulation in bridges and tunnels
Visual studio shortcuts that improve efficiency, summary (updated from time to time)
Minesweeper game - C language
Gaussian distribution and its maximum likelihood estimation
12 reasons for MySQL slow query
110道 MySQL面试题及答案 (持续更新)
STM32HAL库修改Hal_Delay为us级延时
PWN ROP
.NET-9.乱七八糟的理论笔记(概念,思想)
行业落地呈现新进展 | 2022开放原子全球开源峰会OpenAtom OpenHarmony分论坛圆满召开
信息系统项目管理师核心考点(五十五)配置管理员(CMO)的工作
MySQL忘记密码怎么办
centos7安装mysql5.7
MySQL transaction (transaction) (this is enough..)
Moment Pool Cloud quickly installs packages such as torch-sparse and torch-geometric
sql语句-如何以一个表中的数据为条件据查询另一个表中的数据
Open Source Smart Future | 2022 OpenAtom Global Open Source Summit OpenAtom openEuler sub-forum was successfully held