mirror of
https://github.com/golang/go.git
synced 2024-11-22 05:40:42 +00:00
Revert 46f1dbefd64df19e313a966e76c1ec3a36d8788e...4227ff00319069d3d6dd2dde09c41f410a38d982 on Home
parent
f8caa2dd1d
commit
d7b1f5842d
509
Home.md
509
Home.md
@ -1,254 +1,255 @@
|
||||
This page collects experience reports about problems with Go that might inform our design of solutions to those problems. These reports should focus on the _problems_: they should not focus on and need not propose solutions. To propose solutions, see the [proposal process](https://golang.org/s/proposal).
|
||||
|
||||
We hope to use these experience reports to understand where people are having trouble writing Go, to help us prioritize future changes to the Go ecosystem. (We do not promise to reply to these. If you need immediate help answering questions about Go, see [https://golang.org/help/](https://golang.org/help/) for resources.)
|
||||
|
||||
__The best experience reports tell: (1) what you wanted to do, (2) what you actually did, and (3) why that wasn’t great, illustrating those by real concrete examples, ideally from production use.__ Please write these reports about the problems most significant to you, post them on your own blog, or on Medium, or as a [Github Gist](https://gist.github.com/) (use a `.md` extension for Markdown), or as a publicly-readable Google doc, and then link them here. (Talk videos or slides are also welcome, although they are not as convenient for us to digest.)
|
||||
|
||||
If you do not have permission to edit the wiki to add an article to this list, [please file an issue](https://golang.org/issue/new).
|
||||
|
||||
Please keep the overall page sorted alphabetically by section (Error Handling before Logging, and so on).
|
||||
Within a section, please keep articles sorted chronologically.
|
||||
It's helpful to include a one-phrase summary of the point of each article.
|
||||
|
||||
Add new sections as appropriate.
|
||||
|
||||
**Table of Contents**
|
||||
|
||||
- [App and Game Development](#app-and-game-development)
|
||||
- [Concurrency](#concurrency)
|
||||
- [Casting](#casting)
|
||||
- [Context](#context)
|
||||
- [Declarations](#declarations)
|
||||
- [Dependencies](#dependencies)
|
||||
- [Documentation](#documentation)
|
||||
- [Diagnostics and Debugging](#diagnostics-and-debugging)
|
||||
- [Education and Teaching](#education-and-teaching)
|
||||
- [Error Handling](#error-handling)
|
||||
- [File System](#file-system)
|
||||
- [Generics](#generics)
|
||||
- [GoMobile](#gomobile)
|
||||
- [Immutability](#immutability)
|
||||
- [Inter Process Communication](#inter-process-communication)
|
||||
- [Large-Scale Software Development](#large-scale-software-development)
|
||||
- [Logging](#logging)
|
||||
- [Misc/Multiple](#misc--multiple)
|
||||
- [Modules](#modules)
|
||||
- [Performance](#performance)
|
||||
- [Porting](#porting)
|
||||
- [Slices](#slices)
|
||||
- [Syntax](#syntax)
|
||||
- [Time](#time)
|
||||
- [Tooling](#tooling)
|
||||
- [Type System](#type-system)
|
||||
- [Typed nils](#typed-nils)
|
||||
- [Vendoring](#vendoring)
|
||||
|
||||
## App and Game Development
|
||||
|
||||
- Paul Ruest, "[Go Library Support for Apps and Games](https://gazed.github.io/goApps.html)", November 2017
|
||||
- Tad Vizbaras, "[Building Optical Character Recognition (OCR) in Go](http://recoink.com/goreport)", December 2017
|
||||
|
||||
## Casting
|
||||
|
||||
- Richard Warburton, "[Should Go Casting be permitted when underlying data structures are the same?](https://gist.github.com/krolaw/f010ab0966fd379725ecc48e8bbcac1c)", December 2017
|
||||
|
||||
## Concurrency
|
||||
|
||||
- Sergey Kamardin, “[A Million WebSockets and Go](https://medium.freecodecamp.org/million-websockets-and-go-cc58418460bb),” August 2017, about the memory overhead of blocked read/write goroutines.
|
||||
- Nathaniel J. Smith, “[Notes on structured concurrency, or: Go statement considered harmful](https://vorpus.org/blog/notes-on-structured-concurrency-or-go-statement-considered-harmful/)”, April 2018.
|
||||
|
||||
## Context
|
||||
|
||||
- Sam Vilain, “[Using Go's context library for making your logs make sense](https://blog.gopheracademy.com/advent-2016/context-logging/),” December 2016, about extracting structured log values from context.
|
||||
- Jon Calhoun, “[Pitfalls of context values and how to avoid or mitigate them in Go](https://www.calhoun.io/pitfalls-of-context-values-and-how-to-avoid-or-mitigate-them/),” February 2017.
|
||||
- Michal Štrba, "[Context should go away for Go 2](https://faiface.github.io/post/context-should-go-away-go2/)," August 2017
|
||||
- Axel Wagner, "[Why context.Value matters and how to improve it](https://blog.merovius.de/2017/08/14/why-context-value-matters-and-how-to-improve-it.html)," August 2017.
|
||||
- Dave Cheney, "[Context isn't for cancellation](https://dave.cheney.net/2017/08/20/context-isnt-for-cancellation)," August 2017.
|
||||
- Ross Light, "[Canceling I/O in Go Cap'n Proto](https://medium.com/@zombiezen/canceling-i-o-in-go-capn-proto-5ae8c09c5b29)," January 2018.
|
||||
- Iman Tumorang, "[Avoiding Memory Leak in Golang API](https://hackernoon.com/avoiding-memory-leak-in-golang-api-1843ef45fca8)," January 2018.
|
||||
|
||||
## Declarations
|
||||
|
||||
- Christophe Meessen, "[Problems with Go's shorthand declaration :=](https://gist.github.com/chmike/ac0113afefbc04e67323b4a3688d6b54#file-godeclareproblem-md)", July 2017, about the shadowing var trap and apparent inconsistency of `:=`.
|
||||
- Brian Will, "[Go's := syntax is error-prone with multiple target variables](https://gist.github.com/BrianWill/671ce51e6ef6a9f0caa27272a9a0637f)", August 2017.
|
||||
|
||||
## Dependencies
|
||||
|
||||
- John Doe, "[Forks, import paths, and `go get`](https://gist.github.com/johnAnonDoe/2071b8811300c6c08ac21cc8da9fa4d3)", July 2017.
|
||||
- Patrick Bohan, "[Docker => Moby: Go Dependencies](http://engineering.rallyhealth.com/go/golang/dependencies/package-managers/2017/06/28/go-and-dependencies.html)," Jun 28, 2017. A new Go team's struggles with dependency management and an approach to deal with them.
|
||||
- Judson Lester, "[untitled gist] (https://gist.github.com/nyarly/edb6b7a5e3a762da6a5e2da8f59acf07)", August 2017.
|
||||
- David Collier-Brown, "[Avoiding an NP-Complete Problem by Recycling Multics’ Answer](https://leaflessca.wordpress.com/2018/09/03/avoiding-an-np-complete-problem-by-recycling-multics-answer/)", September 2018.
|
||||
|
||||
## Diagnostics and Debugging
|
||||
|
||||
- Kevin Burke, "[How I'm running benchmarks and printing their results](https://github.com/kevinburke/go-html-boilerplate/blob/master/Makefile#L38)", it would be nice if I didn't need so much Unix glue to run and print these. July 2017.
|
||||
- John Clarke, Tracking down an intermittent fault (not a race) by running a very slow {hit test failure, increase logging} cycle by running "do { go test -race } while ( $LASTEXITCODE -eq 0 )" overnight. Over many nights. Execution trace functionality like https://rr-project.org/ would be transformative. November 2018.
|
||||
|
||||
## Education and Teaching
|
||||
|
||||
- Carl Kingsford and Phillip Compeau, "[Go 2.0 for Teaching](http://www.monogrammedchalk.com/go-2-for-teaching/)". Experience using Go in an introductory programming course.
|
||||
|
||||
## Documentation
|
||||
|
||||
- Kevin Burke, "[Need to add documentation for a binary in three different places](https://github.com/golang/go/issues/20212)", May 2017.
|
||||
|
||||
## Error Handling
|
||||
|
||||
(This section is about writing `if err != nil`.)
|
||||
|
||||
- Andrew Gerrand, “[Error Handling and Go](https://blog.golang.org/error-handling-and-go),” July 2011,
|
||||
showing Go error handling patterns.
|
||||
- Martin Sústrik, “[Why should I have written ZeroMQ in C, not C++ (part I)](http://www.250bpm.com/blog:4),” May 2012,
|
||||
discussing production problems with C++ exception handling due to error-handling code being far from code that causes the error.
|
||||
- Thomi Richards, “[The Problems with Errors](http://www.tech-foo.net/the-problems-with-errors.html),” March 2014,
|
||||
arguing that it's essential for code to document exactly which errors it returns / exceptions it might throw.
|
||||
- Roger Peppe, “[Lovin' your errors](https://rogpeppe.neocities.org/error-loving-talk/index.html),” March 2015, discussing idioms for error handling.
|
||||
- Bleve, “[Deferred Cleanup, Checking Errors, and Potential Problems](http://www.blevesearch.com/news/Deferred-Cleanup,-Checking-Errors,-and-Potential-Problems/),” September 2015,
|
||||
showing a bug related to error handling and defer in Bleve search.
|
||||
- Andrew Morgan, “[What I Don't Like About Error Handling in Go, and How to Work Around It](https://opencredo.com/why-i-dont-like-error-handling-in-go/),” January 2017,
|
||||
about it being difficult to force good error handling, errors not having stack traces, and error handling being too verbose.
|
||||
- André Hänsel, "[If Ⅰ were to make my own Go…](https://blog.creations.de/?p=223)", August 2017
|
||||
- Peter Goetz, "[Thinking About New Ways of Error Handling in Go 2](https://medium.com/@peter.gtz/thinking-about-new-ways-of-error-handling-in-go-2-e56d116952f1)," September 2017, shows how error-prone error handling in Go is and lays out requirements to improve the experience.
|
||||
|
||||
## Error Values
|
||||
|
||||
(This section is about additional error semantics beyond the `Error() string` method.)
|
||||
|
||||
- Andrew Morgan, “[What I Don't Like About Error Handling in Go, and How to Work Around It](https://opencredo.com/why-i-dont-like-error-handling-in-go/),” January 2017,
|
||||
about it being difficult to force good error handling, errors not having stack traces, and error handling being too verbose.
|
||||
- Chris Siebenmann, “[Go's net package doesn't have opaque errors, just undocumented ones](https://utcc.utoronto.ca/~cks/space/blog/programming/GoNetErrorsUndocumented),” August 2018
|
||||
|
||||
## File System
|
||||
|
||||
- Chris Lewis, “[Non-Local File Systems Should Be Supported](https://gist.github.com/cflewis/87843028576459b0f6ebf55f1b200891),” July 2017. Proposes replacing file system read calls to something more abstracted like the `sql` package does.
|
||||
|
||||
## Generics
|
||||
|
||||
- “[Summary of Go Generics Discussions (living document)](https://docs.google.com/document/d/1vrAy9gMpMoS3uaVphB32uVXX4pi-HnNjkMEgyAHX4N4/edit).”
|
||||
- Mike Schinkel, "[Type Compatibility with Interface Slices](https://mikeschinkel.me/type-compatibility-with-interface-slices/)", December 2018
|
||||
- Bouke van der Bijl, “[Idiomatic Generics in Go](https://web.archive.org/web/20141001043016/http://bouk.co/blog/idiomatic-generics-in-go/),” September 2014.
|
||||
- Craig Weber, “[Living without generics in Go](https://web.archive.org/web/20141227092139/http://www.weberc2.com/posts/2014/12/12/living-without-generics.txt),” December 2014.
|
||||
- Shashank Sharma, “[Poor man's generics in Golang (Go)](https://codeblog.shank.in/poor-mans-generics-in-golang/),” May 2016.
|
||||
- Niek Sanders, “[Overhead of Go's generic sort](https://github.com/nieksand/sortgenerics),” September 2016,
|
||||
documenting the overhead of sorting using sort.Interface instead of specialized code.
|
||||
- Jon Calhoun, “[Using code generation to survive without generics in Go](https://www.calhoun.io/using-code-generation-to-survive-without-generics-in-go/),” May 2017.
|
||||
- Jon Bodner, “[Closures are the Generics for Go](https://medium.com/capital-one-developers/closures-are-the-generics-for-go-cb32021fb5b5),” June 2017.
|
||||
- Andrew Stock, "[Why I miss generics in Go](https://medium.com/@watchforstock/why-i-miss-generics-in-go-9aef810a1bef)," June 2017
|
||||
- Kevin Burke, "[Code example with lots of interface casts](https://gist.github.com/kevinburke/a10aed6d8d07ecd5efe658b21cd168c1)," requires a lot of boilerplate/casts.
|
||||
- Ian Lance Taylor, "[The append function](https://www.airs.com/blog/archives/559)," July 2017.
|
||||
- DeedleFake, "[The Problem with Interfaces](https://deedlefake.com/2017/07/the-problem-with-interfaces/)", July 2017.
|
||||
- Kurtis Nusbaum "[Why I'm So Frustrated With Go](https://hackernoon.com/why-im-so-frustrated-with-go-97c0c4ae214e)," June 2017
|
||||
- Juan Álvarez, "[Generics on Go's stdlib](https://medium.com/@shixzie/generics-on-gos-stdlib-10de52fe824d)", July 2017.
|
||||
- David Chase, "[A use case for Go Generics in a Go Compiler](https://dr2chase.wordpress.com/2017/08/09/a-use-case-for-go-generics-in-a-go-compiler/)", August 2017
|
||||
- Varun Kumar, "[Generics - I Wish You Were Here...](https://varunksaini.com/blog/use-case-for-generics/)", August 2017
|
||||
- Sameer Ajmani, "[Go Experience Report for Generics: Google metrics API](https://medium.com/@sameer_74231/go-experience-report-for-generics-google-metrics-api-b019d597aaa4)", August 2017
|
||||
- Chewxy, "[Tensor Refactor: A Go Experience Report](https://blog.chewxy.com/2017/09/11/tensor-refactor/)", September 2017, discusses the lack of generics and how it affects building high performance multidimensional arrays for different data types (having to resort to a lot of pointer ugliness, and manually keeping track of type and runtime type checking)
|
||||
- qwerty2501,"[A problem runtime error due to lack of Generics](https://gist.github.com/qwerty2501/8839af87946571943a6c4f623c6124e2)", October 2017
|
||||
- posener, "[Why I recommend to avoid using the go-kit library](https://gist.github.com/posener/330c2b08aaefdea6f900ff0543773b2e)", clear separation of concern need lots of boilerplate code. gokit try
|
||||
code generation to avoid this [#70](https://github.com/go-kit/kit/issues/70) [#308](https://github.com/go-kit/kit/pull/308) [protoc-gen-gokit](https://github.com/AmandaCameron/protoc-gen-gokit) , but it looks like
|
||||
a complex solution for the problem.
|
||||
- Xavier Leroy, "[A modular module system](http://gallium.inria.fr/%7Exleroy/publi/modular-modules-jfp.pdf)", paper about module description for generics.
|
||||
- Tobias Gustafsson, "[Experiences implementing PEDS](https://github.com/tobgu/peds/blob/master/experience_report.md)", PEDS is a set of statically type safe, immutable/persistent, collections. November 2017
|
||||
- A Googler "[govisor/generics.go](https://github.com/google/gvisor/blob/master/tools/go_generics/generics.go)". April 27, 2018
|
||||
|
||||
## GoMobile
|
||||
|
||||
- Vijay, "[Nested structs and slices not supported in gomobile]"
|
||||
|
||||
## Immutability
|
||||
|
||||
- Kurtis Nusbaum "[Why I'm So Frustrated With Go](https://hackernoon.com/why-im-so-frustrated-with-go-97c0c4ae214e)," June 2017
|
||||
- Sindre Myren "[Go 2.0: Retain simplicity by trading features](https://medium.com/@smyrman/go-2-0-retain-simplicity-by-trading-features-b310b60862ea)" July 2017
|
||||
- Tobias Gustafsson, "[Experiences implementing PEDS](https://github.com/tobgu/peds/blob/master/experience_report.md)", PEDS is a set of statically type safe, immutable/persistent, collections. November 2017
|
||||
|
||||
## Inter Process Communication
|
||||
|
||||
- Pablo R. Larraondo "[A Go interprocess communication model](https://gist.github.com/prl900/a7aaa41707e2236592da5e78d8a10dc9)," August 2017
|
||||
|
||||
## Large-Scale Software Development
|
||||
|
||||
- Russ Cox, “[Codebase Refactoring (with help from Go)](https://talks.golang.org/2016/refactor.article),” November 2016, laying out the gradual code repair problem addressed in part by type aliases ([#18130](https://golang.org/issue/18130)).
|
||||
|
||||
## Logging
|
||||
|
||||
- Evan Miller, “[Logging can be tricky](http://corner.squareup.com/2014/09/logging-can-be-tricky.html),” September 2014,
|
||||
showing how logging can add to application tail latency.
|
||||
- Dave Cheney, “[Let's talk about logging](https://dave.cheney.net/2015/11/05/lets-talk-about-logging),” November 2015,
|
||||
arguing that there are only two log levels.
|
||||
- TJ Holowaychuk, “[Apex log](https://medium.com/@tjholowaychuk/apex-log-e8d9627f4a9a),” January 2016, describing a structured log package and how it would be used in production.
|
||||
- Paddy Foran, “[Logging in Go](http://tech.dramafever.com/golang/2016/02/08/logging-in-go),” February 2016, showing how DramaFever sends Go program logs to Sentry.
|
||||
- Martin Angers, “[About Go logging for reusable packages](https://www.0value.com/about-go-logging),” March 2016, making suggestions for how to write code that doesn't assume a particular log package.
|
||||
- BugReplay.com, “[How to use Google Cloud's Free Structured Logging Service With Golang](http://blog.bugreplay.com/post/150086459149/how-to-use-google-clouds-free-structured-logging),” September 2016.
|
||||
- Sam Vilain, “[Using Go's context library for making your logs make sense](https://blog.gopheracademy.com/advent-2016/context-logging/),” December 2016, about extracting structured log values from context.
|
||||
- Logmatic, “[Our Guide to a Golang Logs World](https://logmatic.io/blog/our-guide-to-a-golang-logs-world/),” March 2017.
|
||||
- Chris Hines, Peter Bourgon, “[Proposal: standard Logger interface](https://docs.google.com/document/d/1shW9DZJXOeGbG9Mr9Us9MiaPqmlcVatD_D8lrOXRNMU/edit?usp=drive_web),“ February 2017, problems related to stdlib logger, especially in the context of libraries, and one proposed solution.
|
||||
- Sindre Myren, "[There is nothing Goish about log.Fatal](https://medium.com/@smyrman/there-is-nothing-goish-about-log-fatal-4ab24ae5ba7)" August 2017, how poorly log.Fatal plays with defer, and a simple pattern for delaing with it in Go 1.x and Go 2.x.
|
||||
|
||||
## Misc / Multiple
|
||||
|
||||
- Iman Tumorang, "[Trying Clean Architecture on Golang](https://hackernoon.com/golang-clean-archithecture-efd6d7c43047)" July 2017
|
||||
- Laurent Demailly, "[My Go lang experience, part 1](https://laurentsv.com/blog/2017/12/28/about-golang.html)" December 2017, a laundry list of pros and cons with current Go from an experienced C/C++/Java/Scripting languages developer perspective.
|
||||
- Gokcehan Kara, "[Installation with Go Language can be Simpler](https://gokcehan.github.io/posts/installation-with-go-language-can-be-simpler.html)" May 2018, some complications about the installation and distribution of static stripped binaries with version information.
|
||||
- Bob Nystrom, "[The Language I Wish Go Was](https://journal.stuffwithstuff.com/2010/10/21/the-language-i-wish-go-was/)" October 2010, I wish Go had tuples, unions, constructors, no Nil, exceptions, generics, some syntax sugar, and ponies that shoot Cheez Whiz out of their noses.
|
||||
|
||||
## Modules
|
||||
|
||||
- Paul Jolly - "[Creating a submodule within an existing module](https://gist.github.com/myitcv/79c3f12372e13b0cbbdf0411c8c46fd5)" - covers multi-module repos, cyclic module dependencies and the steps required to move between various "states"
|
||||
- Sam Whited -"[Mod file format](https://write.as/7un2fvf4124bm5s0.md)" - complaint about reinventing the serialization format wheel for mod files.
|
||||
|
||||
## Performance
|
||||
|
||||
- Kevin Burke, "[Real Life Go Benchmarking](https://kev.inburke.com/kevin/real-life-go-benchmarking/)," trying to explain to the average developer how to use tools like pprof, maybe this could be easier. July 2016.
|
||||
- Nathan Kerr, "[Concurrency Slower?](https://pocketgophers.com/concurrency-slower/)", shows how to use Go's testing, benchmarking, and profiling tools to improve the performance of a concurrent implementation of a function. April 2017.
|
||||
|
||||
## Porting
|
||||
|
||||
- Shannon Pekary, "[Why GOPP](https://github.com/spekary/gopp/blob/master/Why.md)," an attempt to create
|
||||
a 'class' keyword that simply makes a struct to also be an interface to make porting code from object-oriented languages much easier.
|
||||
|
||||
## Slices
|
||||
|
||||
- Mike Schinkel, "[Type Compatibility with Interface Slices](https://mikeschinkel.me/type-compatibility-with-interface-slices/)", December 2018
|
||||
- Richard Warburton, "[Should Go 2.0 support slice comparison?](https://gist.github.com/krolaw/3205a3139d423b0c39e24b98c923b1a1)," an argument to treat slices as structs for equality comparison, ignoring backing arrays.
|
||||
- "[Deduplicating a slice is too cumbersome](https://gist.github.com/kevinburke/ad20587e6694acb9251f7d7e25c77078)," a 10-line function in your source code vs. e.g. Ruby's `uniq` function.
|
||||
- "[Counter-intuitive behaviour of Go variadic functions](https://gist.github.com/dpinela/f7fdeb0ce3e1f0b4f495917ad9210a85),", January 2018, stumbling blocks encountered when expanding slices into argument lists.
|
||||
|
||||
## Syntax
|
||||
|
||||
- André Hänsel, "[If Ⅰ were to make my own Go…](https://blog.creations.de/?p=223)", August 2017
|
||||
|
||||
## Time
|
||||
|
||||
- John Graham-Cumming, “[How and Why the Leap Second Affected Cloudflare DNS](https://blog.cloudflare.com/how-and-why-the-leap-second-affected-cloudflare-dns/),” January 2017, about timing across leap seconds ([#12914](https://golang.org/issue/12914)).
|
||||
|
||||
## Tooling
|
||||
|
||||
- Jonathan Ingram, “[gofmt is not opinionated enough](https://gist.github.com/jonathaningram/2b62022844348f3407518dd3a180ef42)”, August 2017, about ongoing debates between developers regarding code style because `gofmt` is not opinionated enough.
|
||||
- Jean-Laurent de Morlhon, "[Pourquoi Maurice ne doit surtout pas coder en GO](https://www.youtube.com/watch?v=LIFZPzupwgs), talk about Go from a java developper perspective ("go dep" is not enough,...), slides are in english.
|
||||
|
||||
## Type System
|
||||
|
||||
- Mike Schinkel, "[Type Compatibility with Interface Slices](https://mikeschinkel.me/type-compatibility-with-interface-slices/)", December 2018
|
||||
- Sam Whited, “[Faking Enumeration Types with Consts and Unexported Types](https://gist.github.com/SamWhited/6cdbc49b4562e1a1b0526af523f5c5d7)”, July 2017, about attempting to ensure compile time correctness of values provided to an API using the type system.
|
||||
- Andreas Matuschek, "[Operator Methods](https://gist.github.com/maj-o/9cab355e3e5e4f6f66dbf0a8f24cd13a)", July 2017, just to remember that there are problems with types without corresponding operators ([#19770](https://github.com/golang/go/issues/19770)).
|
||||
- Leigh McCulloch, "[Go Experience Report: Pointers](https://leighmcculloch.com/go-experience-reports/pointers.html)", July 2017, about pointers being used for both transferring ownership and indicating a lack of value.
|
||||
- Jack Lindamood, "[Interface wrapping method erasure](https://medium.com/@cep21/interface-wrapping-method-erasure-c523b3549912)", July 2017, about the loss of information due to type wrappers
|
||||
- Sam Whited, “[The Case for interface{}](https://blog.samwhited.com/2017/08/the-case-for-interface/)”, Aug 2017, two examples of using interface and why one is bad (but necessary) and one is good.
|
||||
- James Frasché, "[Sum types experience report](https://gist.github.com/jimmyfrasche/ba2b709cdc390585ba8c43c989797325)", Aug 2017, issues caused by inability to restrict to a closed set of types
|
||||
- Robin Eklind, "[Specific use cases. In response to James Frasché's 'Sum types experience report'](https://gist.github.com/jimmyfrasche/ba2b709cdc390585ba8c43c989797325#gistcomment-2181410)", Aug 2017, issues caused by inability to restrict to a closed set of types
|
||||
- Rick Branson, "[Implicit Pointers = Explicitly Bad](https://docs.google.com/document/d/1va7f4YvExK4mNBmMt2RMg1SNSHyljc8ARVp2ATKtBwU/edit?usp=sharing)", Sep 2017, issues encountered with parameters/variables with interface types as implicit references
|
||||
- Chewxy, "[Tensor Refactor: A Go Experience Report](https://blog.chewxy.com/2017/09/11/tensor-refactor/)", September 2017, issues regarding discussion of a type system in Go
|
||||
- Walter Schulze, "[Generic functions cannot be passed as values](https://gist.github.com/awalterschulze/e3999f8cfa29b246c35a651a2be4d121)", September 2017
|
||||
- Walter, Schulze, "[For Sum Types: Multiple return parameters are overrated](https://awalterschulze.github.io/blog/post/sum-types-over-multiple-returns/)", September 2017
|
||||
- Nicolas, Boulay "[Sum type not always the best choice (Typed tagless-final interpretations)](https://gist.github.com/nicolasboulay/a8ee4a65e8c2cc110c20e6d24e838e86), October 2017
|
||||
- Eduard Urbach, "[Type-casting interface{} to chan interface{}](https://github.com/blitzprog/go-channel-type-casting)", October 2017
|
||||
- David Vennik, "[Unjumbling Golang OOP primitives](https://gist.github.com/l0k1verloren/344956daedb434094e9af2c21ff9376c)", April 20, 2018 - The problem of the lack of structuring in OOP primitives - dummy functions and redundant boilerplate type bindings.
|
||||
- Jelte Fennema, "[Fixing the billion dollar mistake in Go by borrowing from Rust](https://getstream.io/blog/fixing-the-billion-dollar-mistake-in-go-by-borrowing-from-rust/)", June 14, 2018 - Nil pointer dereferences cause panics in production - it would be great if the type system would catch some of those.
|
||||
|
||||
## Typed nils
|
||||
|
||||
- David Cheney, "[Typed nils in Go 2](https://dave.cheney.net/2017/08/09/typed-nils-in-go-2)", August 2017.
|
||||
|
||||
## Vendoring
|
||||
|
||||
- Jeremy Loy, "[Go Modules and Vendoring](https://github.com/golang/go/issues/27227#issuecomment-420428896)", September 2018.
|
||||
Welcome to the Go wiki, a collection of information about the [Go Programming Language](https://golang.org/). [Awesome Go](http://awesome-go.com/) is another great resource for Go programmers, curated by the Go community.
|
||||
|
||||
## Contributing ##
|
||||
|
||||
* This wiki is open to editing by any member of the Go community with a GitHub account.
|
||||
* If you would like to add a new page, please first open an issue in the [Go issue tracker](https://github.com/golang/go/issues) with the prefix 'wiki' to propose the addition. Clearly state why the content does not fit into any of the existing pages.
|
||||
* Because renaming of pages in the wiki can break external links, please open an issue before renaming or removing any wiki page.
|
||||
|
||||
|
||||
Table of Contents
|
||||
=================
|
||||
|
||||
+ [Getting started with Go](#getting-started-with-go)
|
||||
+ [Working with Go](#working-with-go)
|
||||
+ [Learning more about Go](#learning-more-about-go)
|
||||
+ [The Go Community](#the-go-community)
|
||||
+ [Using the go toolchain](#using-the-go-toolchain)
|
||||
+ [Additional Go Programming Wikis](#additional-go-programming-wikis)
|
||||
+ [Online Services that work with Go](#online-services-that-work-with-go)
|
||||
+ [Troubleshooting Go Programs in Production](#troubleshooting-go-programs-in-production)
|
||||
+ [Contributing to the Go Project](#contributing-to-the-go-project)
|
||||
+ [Platform Specific Information](#platform-specific-information)
|
||||
+ [Release Specific Information](#release-specific-information)
|
||||
+ [Questions](Questions)
|
||||
|
||||
## Getting started with Go
|
||||
|
||||
- [The Go Tour](http://tour.golang.org) is the best place to start.
|
||||
- [Effective Go](https://golang.org/doc/effective_go.html) will help you learn how to write idiomatic Go code.
|
||||
- [Go standard library documentation](https://golang.org/pkg/) to familiarize yourself with the standard library.
|
||||
- [Use the Go Playground](http://play.golang.org) to test out Go programs in your browser.
|
||||
- Still not convinced? Check out this list of [Go Users](GoUsers) and a few of their [Success stories](SuccessStories). We've also assembled a long list of reasons [why you should give Go a try](whygo).
|
||||
- Read about the companies which have [switched from other languages to Go](https://github.com/golang/go/wiki/FromXToGo).
|
||||
|
||||
## Working with Go
|
||||
|
||||
Ready to write some Go code of your own? Here are a few links to help you get started.
|
||||
|
||||
- Install and Setup your Environment
|
||||
- Start here: [Official Installation Documentation](https://golang.org/doc/install)
|
||||
- If you prefer to install from source, [read this first](https://golang.org/doc/install/source).
|
||||
- [InstallFromSource](InstallFromSource) - Additional tips on source installs.
|
||||
- Windows user? [Install and configure Go, Git and Atom for Windows](https://github.com/abourget/getting-started-with-golang)
|
||||
- Mac user? [How I start - Go](https://howistart.org/posts/go/1) - A step-by-step guide to installing Go and building your first web service.
|
||||
- Having installation problems? [InstallTroubleShooting](InstallTroubleShooting)
|
||||
- Make sure you have your [$GOPATH environment variable set correctly](https://golang.org/doc/install/source#gopath)
|
||||
- If you need additional tips on using [$GOPATH, go here](GOPATH).
|
||||
- [MultipleGoRoots](MultipleGoRoots) - More advanced information on working with multiple go installations and the `$GOROOT` variable.
|
||||
- [Go IDEs and Editors](IDEsAndTextEditorPlugins) - Information on how to use your favorite editor with Go.
|
||||
- [Tools for working with Go code](CodeTools) - Formatting, linting, vetting, refactoring, navigation and visualization.
|
||||
- Finding Go Libraries and Packages
|
||||
- Start here: [Go open source projects](Projects).
|
||||
- Search for Go packages: [godoc.org](http://godoc.org)
|
||||
- Visualization of the [Go open source package graph](https://anvaka.github.io/pm/#/galaxy/gosearch?l=1)
|
||||
- [Managing your dependencies](PackageManagementTools) - An overview of the tools you can use to manage third-party packages (vendoring).
|
||||
- Publishing Go Packages as Open Source
|
||||
- Getting ready to publish your package? [Start here.](PackagePublishing)
|
||||
- [The Go Checklist](https://github.com/matttproud/gochecklist) - A comprehensive guide for publishing a project.
|
||||
- [How to layout your GitHub repo](GitHubCodeLayout) to make it easy to for other Go programmers to use with the `go get` command.
|
||||
- [Go Package, Go](https://johnsto.co.uk/blog/go-package-go) - A few recommendations for making Go packages easy to use.
|
||||
|
||||
## Learning more about Go
|
||||
|
||||
Once you have an overview of the language, here are resources you can use to learn more.
|
||||
|
||||
- [Learning Go](Learn) - A collection of resources for learning Go - beginner to advanced.
|
||||
- [Best Practices for a New Go Developer](https://medium.com/@IndianGuru/best-practices-for-a-new-go-developer-8660384302fc) - Insights from Go community members.
|
||||
- [Server programming](LearnServerProgramming) - Building web, mobile, and API servers.
|
||||
- [More on concurrency](LearnConcurrency)
|
||||
- [More on error handling](LearnErrorHandling)
|
||||
- [More on testing](LearnTesting)
|
||||
- [More on mobile - Android and iOS](Mobile)
|
||||
- [Books](Books) - A list of Go books that have been published (ebook, paper)
|
||||
- [Blogs](Blogs) - Blogs about Go
|
||||
- [Podcasts](Podcasts) - Podcasts and episodes featuring Go
|
||||
- Videos, Talks and Presentations
|
||||
- [GopherVids](http://gophervids.appspot.com/) is a searchable index of videos about Go.
|
||||
- [GoTalks](GoTalks) - A collection of talks from Go conferences and meetups.
|
||||
- [Screencasts](Screencasts)
|
||||
- [Articles](Articles) - A collection of articles to help you learn more about Go.
|
||||
- [Training](Training) - Free and commercial, online and classroom training for Go.
|
||||
- [University Courses](Courses) - A list of CS programs and classes using Go.
|
||||
- [Resources for non-English speakers](NonEnglish)
|
||||
|
||||
## The Go Community
|
||||
|
||||
Here are some of the places where you can find Gophers online. To get a sense of what it means to be a member of the Go community, read [Damian Gryski's keynote from the GolankUK 2015 conference](https://medium.com/@dgryski/the-go-community-f0d00e3a19e) or watch [Andrew Gerrand's closing keynote from GopherCon 2015](https://www.youtube.com/watch?v=0ht89TxZZnk).
|
||||
|
||||
|
||||
- Where Gophers hangout online:
|
||||
- [The Go Forum](https://forum.golangbridge.org/) - An all-purpose discussion forum for the Go community.
|
||||
- [Gophers Slack Channel](http://gophers.slack.com/) - For real-time chat ([request membership](http://blog.gopheracademy.com/gophers-slack-community/)).
|
||||
- [Golang News](http://golangnews.com) - For curated links about Go Programming.
|
||||
- There is also a [/r/golang](http://reddit.com/r/golang) sub-reddit.
|
||||
- On Twitter, follow the [@golang](https://twitter.com/golang) account and keep tabs on the [#golang](https://twitter.com/search?q=%23golang&src=typd) hashtag.
|
||||
- We've also got a landing page on [Stack Overflow](http://stackoverflow.com/tags/go) for Go Q&A.
|
||||
- Matrix enthusiasts are invited to join [#Go:matrix.org](https://riot.im/app/#/room/#Go:matrix.org).
|
||||
- Discord users are welcome at the [Discord Gophers](https://discord.gg/VF92f7M) server.
|
||||
- Hashnode users talk and write about Go in [Hashnode Go community](https://hashnode.com/n/go).
|
||||
- Mailing Lists
|
||||
- The mailing list for Go users is [golang-nuts](https://groups.google.com/forum/#!forum/golang-nuts) - very high traffic.
|
||||
- Before you post, [check to see if it's already been answered](http://stackoverflow.com/tags/go), then read [these tips on how to ask a good question](HowToAsk)
|
||||
- For discussions about the core Go open source project, join [golang-dev](https://groups.google.com/forum/#!forum/golang-dev).
|
||||
- To get just our release announcements, join [golang-announce](https://groups.google.com/forum/#!forum/golang-announce)
|
||||
- User Groups & Meetups - There are [Go Meetups in many cities](http://www.meetup.com/find/?allMeetups=false&keywords=golang&radius=Infinity&userFreeform=Sunnyvale%2C+CA&mcId=z94086&mcName=Sunnyvale%2C+CA&sort=recommended&eventFilter=mysugg)
|
||||
- [GoBridge](http://golangbridge.org) - Volunteers helping underrepresented communities to teach technical skills and to foster diversity in Go.
|
||||
- [Women Who Go](http://www.womenwhogo.org/)
|
||||
- See here for [additional information GoUserGroups](GoUserGroups)
|
||||
- [Conferences](Conferences) - A list of upcoming and past Go conferences and major events.
|
||||
- [Companies using Go](GoUsers) - A comprehensive list of companies using Go throughout the world.
|
||||
- Learn more about the [Go Gopher images](Gopher) by Renee French.
|
||||
|
||||
## Using the go toolchain
|
||||
|
||||
- Start with the standard documentation for the `go` command [available here](https://golang.org/cmd/go/)
|
||||
- Start here for to learn about [vendoring](https://golang.org/cmd/go/#hdr-Vendor_Directories).
|
||||
- See also [PackageManagementTools](PackageManagementTools) for package management tools.
|
||||
- [Cross Compilation](https://rakyll.org/cross-compilation/)
|
||||
- Shared libraries and Go (buildmode)
|
||||
- [Go Shared Libraries](https://github.com/jbuberel/buildmodeshared) - Examples for creating and using shared libraries from Go and Python.
|
||||
- [Sharing Go Packages with C](http://blog.ralch.com/tutorial/golang-sharing-libraries/) - by [@ralch](https://twitter.com/ralch).
|
||||
- [Calling Go libraries from Python](https://blog.filippo.io/building-python-modules-with-go-1-5/) - by Filippo Valsorda
|
||||
- [Calling Go libraries from Ruby](http://c7.se/go-and-ruby-ffi/) - by Peter Hellberg
|
||||
- [Calling Go libraries from Swift](https://rakyll.org/swift/) - by Jaana Burcu Dogan
|
||||
- [Build a Ruby Gem with a Go native extension](http://blog.paracode.com/2015/08/28/ruby-and-go-sitting-in-a-tree) - by @jondot
|
||||
- [gohttplib](https://github.com/shazow/gohttplib) - An experiment in using Go 1.5 buildmode=c-shared.
|
||||
- See the wikis below for additional details:
|
||||
- [GoGetTools](GoGetTools)
|
||||
- [GoGetProxyConfig](GoGetProxyConfig)
|
||||
- [cgo](cgo)
|
||||
- [CompilerOptimizations](CompilerOptimizations)
|
||||
- [GccgoCrossCompilation](GccgoCrossCompilation)
|
||||
- [GcToolchainTricks](GcToolchainTricks)
|
||||
- [GoGenerateTools](GoGenerateTools)
|
||||
- [Go Tooling Essentials](https://rakyll.org/go-tool-flags/) - by Jaana Burcu Dogan
|
||||
|
||||
## Additional Go Programming Wikis
|
||||
|
||||
- [Why Go doesn't Support Generics: A Summary of Go Generics Discussions](https://docs.google.com/document/d/1vrAy9gMpMoS3uaVphB32uVXX4pi-HnNjkMEgyAHX4N4/preview) - Start here before you join the debate.
|
||||
- Concurrency
|
||||
- [Timeouts](Timeouts) - Abandon async calls that take too long
|
||||
- [LockOSThread](LockOSThread)
|
||||
- [MutexOrChannel](MutexOrChannel) - When to use one vs the other
|
||||
- [RaceDetector](RaceDetector) - How to detect and fix race conditions
|
||||
- Working with Databases
|
||||
- [database/sql](http://go-database-sql.org/) - Online tutorial for working with the database/sql package.
|
||||
- [TUGTBDDAwG](https://vividcortex.com/resources/building-database-driven-apps-with-go/) - Guide to building data driven apps.
|
||||
- [SQLDrivers](SQLDrivers)
|
||||
- [SQLInterface](SQLInterface)
|
||||
- From other languages
|
||||
- [Go for Java Programmers](http://yourbasic.org/golang/go-java-tutorial/)
|
||||
- [Go for C++ Programmers](GoForCPPProgrammers)
|
||||
- Strings
|
||||
- [GoStrings](GoStrings)
|
||||
- [String Matching](http://blog.gopheracademy.com/advent-2014/string-matching/)
|
||||
- [Comments](Comments)
|
||||
- [CommonMistakes](CommonMistakes)
|
||||
- [Errors](Errors)
|
||||
- [GcToolchainTricks](GcToolchainTricks)
|
||||
- [Hashing](Hashing)
|
||||
- [HttpFetch](HttpFetch)
|
||||
- [HttpStaticFiles](HttpStaticFiles)
|
||||
- [InterfaceSlice](InterfaceSlice)
|
||||
- [Iota](Iota)
|
||||
- [MethodSets](MethodSets)
|
||||
- [PanicAndRecover](PanicAndRecover)
|
||||
- [Range](Range)
|
||||
- [RateLimiting](RateLimiting)
|
||||
- [Rationales](Rationales)
|
||||
- [SendingMail](SendingMail)
|
||||
- [SignalHandling](SignalHandling)
|
||||
- [SimultaneousAssignment](SimultaneousAssignment)
|
||||
- [SliceTricks](SliceTricks)
|
||||
- [Switch](Switch)
|
||||
- [TableDrivenTests](TableDrivenTests)
|
||||
|
||||
|
||||
## Online Services that work with Go
|
||||
|
||||
If you're looking for services that support Go, here's a list to get you started.
|
||||
|
||||
- Cloud Computing - Go is well supported on most cloud service providers.
|
||||
- [Amazon Web Services](https://github.com/aws/aws-sdk-go)
|
||||
- [Azure](https://github.com/Azure/azure-sdk-for-go)
|
||||
- [Digital Ocean](https://github.com/digitalocean/godo)
|
||||
- [GE Predix](https://github.com/geaviation/goboot-starter)
|
||||
- [Google Cloud Platform for Go](https://cloud.google.com/go)
|
||||
- [Heroku](https://github.com/heroku/heroku-buildpack-go)
|
||||
- [IBM Bluemix](https://developer.ibm.com/bluemix/2015/10/28/getting-started-with-golang-on-bluemix/)
|
||||
- [OpenStack](https://github.com/openstack/golang-client)
|
||||
- [Vscale](https://github.com/vscale/go-vscale)
|
||||
- [Aliyun](https://github.com/aliyun/alibaba-cloud-sdk-go)
|
||||
- See here for [information on additional providers](ProviderIntegration)
|
||||
- [Continuous Integration and Continuous Deployment](HostedContinuousIntegration) - Go is well supported by most CI/CD frameworks
|
||||
- Monitoring/Logging
|
||||
- [DeferPanic](http://deferpanic.com) - Dedicated Go application performance monitoring.
|
||||
- [OpsDash](https://www.opsdash.com/) - Go-based cluster monitoring platform.
|
||||
- Package and Dependency Management
|
||||
- [Gopkg.in](http://labix.org/gopkg.in) is a source for stable Go libraries, provided by Gustavo Niemeyer.
|
||||
|
||||
## Troubleshooting Go Programs in Production
|
||||
|
||||
- Understand the performance of your Go apps using the [pprof package](http://blog.golang.org/profiling-go-programs)
|
||||
- Heap Dumps
|
||||
- [heapdump13](heapdump13)
|
||||
- [heapdump14](heapdump14)
|
||||
- [heapdump15](https://github.com/golang/go/wiki/heapdump15)
|
||||
|
||||
## Contributing to the Go Project
|
||||
|
||||
- Start by reading the [Go Contribution Guidelines](https://golang.org/doc/contribute.html)
|
||||
- If you'd like to propose a change to the Go project, start by reading the [Go Change Proposal Process](https://github.com/golang/proposal)
|
||||
- An archive of [design documents is also available](DesignDocuments)
|
||||
- Go releases happen on ~6 month intervals. [See here for more information](Go-Release-Cycle)
|
||||
- Want to know more about how the [Go source sub-repositories are structured?](SubRepositories)
|
||||
- The Go project requires that all code be reviewed before it is submitted.
|
||||
- Read more about our [code review practices](CodeReview)
|
||||
- If you're commenting on code under review, please read [these guidelines](CodeReviewComments)
|
||||
- Issues
|
||||
- Bug reports and feature requests should be filed using the [GitHub issue tracker](https://github.com/golang/go/issues)
|
||||
- Want to understand how we [handle issues that are reported?](HandlingIssues)
|
||||
- Project Dashboards
|
||||
- [Go Builds Dashboard info](DashboardBuilders)
|
||||
- [Performance Dashboard info](PerfDashboard)
|
||||
|
||||
## Platform Specific Information
|
||||
|
||||
- See [MinimumRequirements](MinimumRequirements) for minimum platform requirements of current Go ports.
|
||||
- Considering porting Go to a new platform? [Read our porting policy first](PortingPolicy)
|
||||
- [Mobile](Mobile)
|
||||
- [Ubuntu](Ubuntu)
|
||||
- [Windows](Windows)
|
||||
- [WindowsBuild](WindowsBuild)
|
||||
- [WindowsCrossCompiling](WindowsCrossCompiling)
|
||||
- [WindowsDLLs](WindowsDLLs)
|
||||
- [GoArm](GoArm)
|
||||
- [ChromeOS](ChromeOS)
|
||||
- [Darwin](Darwin)
|
||||
- [DragonFly BSD](DragonFly-BSD)
|
||||
- [FreeBSD](FreeBSD)
|
||||
- [Linux](Linux)
|
||||
- [NativeClient](NativeClient)
|
||||
- [NetBSD](NetBSD)
|
||||
- [OpenBSD](OpenBSD)
|
||||
- [Plan 9](Plan9)
|
||||
- [Solaris](Solaris)
|
||||
|
||||
## Release Specific Information
|
||||
|
||||
- [Go1point1Gotchas](Go1point1Gotchas)
|
||||
- [OlderVersions](OlderVersions)
|
||||
|
||||
Notes:
|
||||
|
||||
- Please refrain from changing the title of the wiki pages, as some of them might be linked to from [golang.org](https://golang.org) or other websites.
|
Loading…
Reference in New Issue
Block a user