当前位置:网站首页>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属于数据链路层还是网络层?有人说是网络层,也有人说是数据链路层。我个人倾向于数据链路层。
边栏推荐
- On-line monitoring system for urban waterlogging and water accumulation in bridges and tunnels
- [Detailed explanation of ORACLE Explain]
- DVWA shooting range environment construction
- MySQL忘记密码怎么办
- mysql stored procedure
- Go中间件
- Fusion Cloud Native, Empowering New Milestones | 2022 Open Atom Global Open Source Summit Cloud Native Sub-Forum Successfully Held
- 【ORACLE Explain 详解】
- Unity URP渲染管线摄像机核心机制剖析
- From scratch, a mirror to the end, a pure system builds a grasscutter (Grasscutter)
猜你喜欢

ERP生产作业控制 金蝶

DVWA installation tutorial (understand what you don't understand · in detail)

【云原生】DevOps(五):集成Harbor

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

12 reasons for MySQL slow query

【debug锦集】Expected input batch_size (1) to match target batch_size (0)

【C语言】操作符详解

Minesweeper game - C language

打造基于ILRuntime热更新的组件化开发

The Vue project connects to the MySQL database through node and implements addition, deletion, modification and query operations
随机推荐
Gaussian distribution and its maximum likelihood estimation
110道 MySQL面试题及答案 (持续更新)
HCIP Day 10_BGP Route Summary Experiment
Unity资源管理系列:Unity 框架如何做好资源管理
开源汇智创未来 | 2022开放原子全球开源峰会OpenAtom openEuler分论坛圆满召开
SQL行列转换
Minesweeper game (written in c language)
WPF WPF 】 【 the depth resolution of the template
Industry-university-research application to build an open source talent ecosystem | 2022 Open Atom Global Open Source Summit Education Sub-Forum was successfully held
Duplicate entry ‘XXX‘ for key ‘XXX.PRIMARY‘解决方案。
【debug锦集】Expected input batch_size (1) to match target batch_size (0)
.NET-6.WinForm2.NanUI学习和总结
DVWA shooting range environment construction
PCL 计算点云坐标最值及其索引
MySQL常见面试题汇总(建议收藏!!!)
visual studio 那些提高效率的快捷键,总结(不时更新)
Summary of MySQL common interview questions (recommended collection!!!)
DVWA installation tutorial (understand what you don't understand · in detail)
XSS shooting range (3) prompt to win
unity2d game