文章分类 - golang
摘要:1. 什么是反射? In computer science, reflection programming is the ability of a process to examine, introspect, and modify its own structure and behavior.[7
阅读全文
摘要:本文结合unicode[2]标准和UTF-8[1](8-bit Unicode Transformation Format)的原理,分析golang标准库中的utf-8实现。 unicode unicode是计算机科学领域的业界标准。它整理、编码了世界上大部分的文字系统,使得电脑可以用更为简单的方式
阅读全文
摘要:golang没有提供try-catch类似的错误处理机制,在设计层面采用了C语言风格的错误处理,通过函数返回值返回出错的错误信息,具体样例如下: func ReturnError() (string, error) { return "", fmt.Errorf("Test Error") } fu
阅读全文