本文主要是介绍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?
这篇关于golang学习笔记——FAQ 1.22.2的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!