golang学习笔记——FAQ 1.22.2

Origins

What is the purpose of the project?

What is the history of the project?

What’s the origin of the gopher mascot?

Is the language called Go or Golang?

Why did you create a new language?

What are Go’s ancestors?

What are the guiding principles in the design?

Usage

Is Google using Go internally?

What other companies use Go?

Do Go programs link with C/C++ programs?

What IDEs does Go support?

Does Go support Google’s protocol buffers?

Design

Does Go have a runtime?

What’s up with Unicode identifiers?

Why does Go not have feature X?

When did Go get generic types?

Why was Go initially released without generic types?

Why does Go not have exceptions?

Why does Go not have assertions?

Why build concurrency on the ideas of CSP?

Why goroutines instead of threads?

Why are map operations not defined to be atomic?

Will you accept my language change?

Types

Is Go an object-oriented language?

How do I get dynamic dispatch of methods?

Why is there no type inheritance?

Why is len a function and not a method?

Why does Go not support overloading of methods and operators?

Why doesn’t Go have “implements” declarations?

How can I guarantee my type satisfies an interface?

Why doesn’t type T satisfy the Equal interface?

Can I convert a []T to an []interface{}?

Can I convert []T1 to []T2 if T1 and T2 have the same underlying type?

Why is my nil error value not equal to nil?

Why are there no untagged unions, as in C?

Why does Go not have variant types?

Why does Go not have covariant result types?

Values

Why does Go not provide implicit numeric conversions?

How do constants work in Go?

Why are maps built in?

Why don’t maps allow slices as keys?

Why are maps, slices, and channels references while arrays are values?

Writing Code

How are libraries documented?

Is there a Go programming style guide?

How do I submit patches to the Go libraries?

Why does “go get” use HTTPS when cloning a repository?

How should I manage package versions using “go get”?

Pointers and Allocation

When are function parameters passed by value?

When should I use a pointer to an interface?

Should I define methods on values or pointers?

What’s the difference between new and make?

What is the size of an int on a 64 bit machine?

How do I know whether a variable is allocated on the heap or the stack?

Why does my Go process use so much virtual memory?

Concurrency

What operations are atomic? What about mutexes?

Why doesn’t my program run faster with more CPUs?

How can I control the number of CPUs?

Why is there no goroutine ID?

Functions and Methods

Why do T and *T have different method sets?

What happens with closures running as goroutines?

Control flow

Why does Go not have the ?: operator?

Type Parameters

Why does Go have type parameters?

How are generics implemented in Go?

How do generics in Go compare to generics in other languages?

Why does Go use square brackets for type parameter lists?

Why does Go not support methods with type parameters?

Why can’t I use a more specific type for the receiver of a parameterized type?

Why can’t the compiler infer the type argument in my program?

Packages and Testing

How do I create a multifile package?

How do I write a unit test?

Where is my favorite helper function for testing?

Why isn’t X in the standard library?

Implementation

What compiler technology is used to build the compilers?

How is the run-time support implemented?

Why is my trivial program such a large binary?

Can I stop these complaints about my unused variable/import?

Why does my virus-scanning software think my Go distribution or compiled binary is infected?

Performance

Why does Go perform badly on benchmark X?

Changes from C

Why is the syntax so different from C?

Why are declarations backwards?

Why is there no pointer arithmetic?

Why are ++ and – statements and not expressions? And why postfix, not prefix?

Why are there braces but no semicolons? And why can’t I put the opening brace on the next line?

Why do garbage collection? Won’t it be too expensive?

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值